node/test/fixtures/test-runner/async-error-in-test-hook.mjs
Alex Yang f098b7a0da
test_runner: better error handing for test hook
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/52401
Fixes: https://github.com/nodejs/node/issues/52399
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-04-15 10:27:17 +00:00

27 lines
425 B
JavaScript

import { after, afterEach, before, beforeEach, test } from 'node:test'
before(() => {
setTimeout(() => {
throw new Error('before')
}, 100)
})
beforeEach(() => {
setTimeout(() => {
throw new Error('beforeEach')
}, 100)
})
after(() => {
setTimeout(() => {
throw new Error('after')
}, 100)
})
afterEach(() => {
setTimeout(() => {
throw new Error('afterEach')
}, 100)
})
test('ok', () => {})