Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test: assert that app exited without signal #74087

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/production/graceful-shutdown/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { once } from 'events'

const appDir = join(__dirname, './src')
let appPort
let app
let app: Awaited<ReturnType<typeof launchApp>>

function assertDefined<T>(value: T | void): asserts value is T {
expect(value).toBeDefined()
Expand Down Expand Up @@ -143,7 +143,7 @@ function runTests(dev = false) {
expect(app.exitCode).toBe(null)

// App finally shuts down
await appKilledPromise
expect(await appKilledPromise).toEqual([0, null])
expect(app.exitCode).toBe(0)
})
} else {
Expand Down Expand Up @@ -180,7 +180,7 @@ function runTests(dev = false) {
expect(responseResolved).toBe(true)

// App finally shuts down
await appKilledPromise
expect(await appKilledPromise).toEqual([0, null])
expect(app.exitCode).toBe(0)
})

Expand Down Expand Up @@ -215,7 +215,7 @@ function runTests(dev = false) {
expect(app.exitCode).toBe(null)

// App finally shuts down
await appKilledPromise
expect(await appKilledPromise).toEqual([0, null])
expect(app.exitCode).toBe(0)
})

Expand All @@ -232,7 +232,7 @@ function runTests(dev = false) {
).rejects.toThrow()

// App finally shuts down
await appKilledPromise
expect(await appKilledPromise).toEqual([0, null])
expect(app.exitCode).toBe(0)
})
})
Expand Down
Loading