mirror of
https://github.com/IT4Change/boilerplate-backend.git
synced 2025-12-13 10:25:49 +00:00
30 lines
635 B
TypeScript
30 lines
635 B
TypeScript
import { startStandaloneServer } from '@apollo/server/standalone'
|
|
|
|
import { listen } from './server'
|
|
|
|
jest.mock('@apollo/server/standalone', () => {
|
|
const originalModule = jest.requireActual('@apollo/server/standalone')
|
|
return {
|
|
__esModule: true,
|
|
...originalModule,
|
|
startStandaloneServer: jest.fn(() => {
|
|
return {
|
|
url: 'url',
|
|
}
|
|
}),
|
|
}
|
|
})
|
|
|
|
describe('server', () => {
|
|
describe('listen', () => {
|
|
beforeEach(async () => {
|
|
jest.clearAllMocks()
|
|
await listen(4000)
|
|
})
|
|
|
|
it('calls startStandaloneServer', () => {
|
|
expect(startStandaloneServer).toBeCalled()
|
|
})
|
|
})
|
|
})
|