Co-Authored-By: Colin Ihrig <cjihrig@gmail.com> PR-URL: https://github.com/nodejs/node/pull/54697 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
35 lines
667 B
JavaScript
35 lines
667 B
JavaScript
'use strict';
|
|
const { before, beforeEach, after, afterEach, test, suite } = require('node:test');
|
|
|
|
function record(data) {
|
|
globalThis.GLOBAL_ORDER.push(data);
|
|
console.log(data);
|
|
}
|
|
|
|
before(function() {
|
|
record(`before two: ${this.name}`);
|
|
});
|
|
|
|
beforeEach(function() {
|
|
record(`beforeEach two: ${this.name}`);
|
|
});
|
|
|
|
after(function() {
|
|
record(`after two: ${this.name}`);
|
|
});
|
|
|
|
afterEach(function() {
|
|
record(`afterEach two: ${this.name}`);
|
|
});
|
|
|
|
suite('suite two', function() {
|
|
record(this.name);
|
|
|
|
before(function() {
|
|
record(`before suite two: ${this.name}`);
|
|
});
|
|
|
|
test('suite two - test', { only: true }, function() {
|
|
record(this.name);
|
|
});
|
|
});
|