added support for testing in hosted context