Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async create(options: Partial = {}) {
await TestMongooseContext.install(options.mongod);
options.mongoose = await TestMongooseContext.getMongooseOptions();
return TestContext.create(options);
}
before(async () => {
await TestContext.create();
this.socketIOServer = {attach: Sinon.stub(), adapter: Sinon.stub()};
this.httpServer = {type: "http", get: Sinon.stub().returns("httpServer")};
this.httpsServer = {type: "https", get: Sinon.stub().returns("httpsServer")};
socketIOService = TestContext.invoke(SocketIOService, [
{provide: HttpServer, use: this.httpServer},
{provide: HttpsServer, use: this.httpsServer},
{provide: SocketIOServer, use: this.socketIOServer}
]);
this.getWebsocketServicesStub = Sinon.stub(socketIOService, "getWebsocketServices");
this.bindProviderStub = Sinon.stub(socketIOService, "bindProvider");
this.printSocketEventsStub = Sinon.stub(socketIOService, "printSocketEvents");
this.getWebsocketServicesStub.returns([{provider: "provider"}]);
before(() => TestContext.create());
before(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
after(() => TestContext.reset());
before(() => TestContext.create());
before(() => TestContext.reset());