node/test/fixtures/test-runner/output/abort_hooks.js
Raz Luvaton 1353681edf
test: remove --no-warnings flag in test_runner fixtures
no longer needed after #48915 fix

PR-URL: https://github.com/nodejs/node/pull/48989
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2023-08-03 19:41:20 +00:00

62 lines
1.2 KiB
JavaScript

'use strict';
const { before, beforeEach, describe, it, after, afterEach } = require('node:test');
describe('1 before describe', () => {
const ac = new AbortController();
before(() => {
console.log('before');
ac.abort()
}, {signal: ac.signal});
it('test 1', () => {
console.log('1.1');
});
it('test 2', () => {
console.log('1.2');
});
});
describe('2 after describe', () => {
const ac = new AbortController();
after(() => {
console.log('after');
ac.abort()
}, {signal: ac.signal});
it('test 1', () => {
console.log('2.1');
});
it('test 2', () => {
console.log('2.2');
});
});
describe('3 beforeEach describe', () => {
const ac = new AbortController();
beforeEach(() => {
console.log('beforeEach');
ac.abort()
}, {signal: ac.signal});
it('test 1', () => {
console.log('3.1');
});
it('test 2', () => {
console.log('3.2');
});
});
describe('4 afterEach describe', () => {
const ac = new AbortController();
afterEach(() => {
console.log('afterEach');
ac.abort()
}, {signal: ac.signal});
it('test 1', () => {
console.log('4.1');
});
it('test 2', () => {
console.log('4.2');
});
});