Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async (t, run) => {
const create = (options && options.createServer) || createServer;
const clock = options && options.lolex ? lolex.install() : lolex.createClock();
const server = await create(options);
await server.listen();
// Useful to fix uncaught exceptions:
// console.log(`${server.options.port} - ${t.title}`);
try {
await run(t, server, clock);
} finally {
if (options && options.beforeServerClose) {
options.beforeServerClose();
}
clock.runAll();
create: function (now) {
return llx.createClock(now);
}
};
create: function (now) {
return llx.createClock(now);
}
};
static createFake() {
var clock = new Clock(true);
clock._clock = lolex.createClock(FAKE_START_TIME);
return clock;
}
create: function(now) {
return llx.createClock(now);
}
};