node/test/fixtures/test-runner/output/abort_hooks.js
Antoine du Hamel ad07869602
tools: enable linter in test/fixtures/test-runner/output
PR-URL: https://github.com/nodejs/node/pull/57698
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-04-04 10:44:21 +02: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');
});
});