17 lines
608 B
TypeScript
17 lines
608 B
TypeScript
import { bootstrapWorker } from './main';
|
|
|
|
describe('bootstrapWorker', () => {
|
|
it('creates an application context without starting an HTTP listener', async () => {
|
|
const close = jest.fn().mockResolvedValue(undefined);
|
|
const enableShutdownHooks = jest.fn();
|
|
const appContext = { close, enableShutdownHooks };
|
|
const createContext = jest.fn().mockResolvedValue(appContext);
|
|
|
|
const app = await bootstrapWorker(createContext as never);
|
|
|
|
expect(createContext).toHaveBeenCalledTimes(1);
|
|
expect(enableShutdownHooks).toHaveBeenCalledTimes(1);
|
|
expect(app).toBe(appContext);
|
|
});
|
|
});
|