When a test is skipped, the corresponding beforeEach and afterEach hooks should also be skipped. Fixes: https://github.com/nodejs/node/issues/52112 PR-URL: https://github.com/nodejs/node/pull/52115 Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
21 lines
355 B
JavaScript
21 lines
355 B
JavaScript
// Flags: --test-reporter=spec
|
|
'use strict';
|
|
const { after, afterEach, before, beforeEach, test } = require('node:test');
|
|
|
|
before(() => {
|
|
console.log('BEFORE');
|
|
});
|
|
|
|
beforeEach(() => {
|
|
console.log('BEFORE EACH');
|
|
});
|
|
|
|
after(() => {
|
|
console.log('AFTER');
|
|
});
|
|
|
|
afterEach(() => {
|
|
console.log('AFTER EACH');
|
|
});
|
|
|
|
test('skipped test', { skip: true });
|