mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
Signed-off-by: Igor <igorshevelenkov4@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61525 Fixes: https://github.com/nodejs/node/issues/61462 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
37 lines
771 B
JavaScript
37 lines
771 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('node:assert');
|
|
const { beforeEach, afterEach, test } = require('node:test');
|
|
|
|
let beforeEachTotal = 0;
|
|
let afterEachRuntimeSkip = 0;
|
|
let afterEachTotal = 0;
|
|
|
|
beforeEach(common.mustCall(() => {
|
|
beforeEachTotal++;
|
|
}, 2));
|
|
|
|
afterEach(common.mustCall((t) => {
|
|
afterEachTotal++;
|
|
if (t.name === 'runtime skip') {
|
|
afterEachRuntimeSkip++;
|
|
}
|
|
}, 2));
|
|
|
|
test('normal test', (t) => {
|
|
t.assert.ok(true);
|
|
});
|
|
|
|
test('runtime skip', (t) => {
|
|
t.skip('skip after setup');
|
|
});
|
|
|
|
test('static skip', { skip: true }, common.mustNotCall());
|
|
|
|
process.on('exit', () => {
|
|
assert.strictEqual(beforeEachTotal, 2);
|
|
assert.strictEqual(afterEachRuntimeSkip, 1);
|
|
assert.strictEqual(afterEachTotal, 2);
|
|
});
|