test: ensure assertions are reachable in more folders · nodejs/node@781a266
@@ -7,7 +7,7 @@ const { setTimeout } = require('node:timers/promises');
77before((t) => t.diagnostic('before 1 called'));
88after((t) => t.diagnostic('after 1 called'));
9910-describe('describe hooks', () => {
10+describe('describe hooks', common.mustCall(() => {
1111const testArr = [];
1212before(function() {
1313testArr.push('before ' + this.name);
@@ -51,9 +51,9 @@ describe('describe hooks', () => {
5151it('nested 1', () => testArr.push('nested 1'));
5252test('nested 2', () => testArr.push('nested 2'));
5353});
54-});
54+}));
555556-describe('describe hooks - no subtests', () => {
56+describe('describe hooks - no subtests', common.mustCall(() => {
5757const testArr = [];
5858before(function() {
5959testArr.push('before ' + this.name);
@@ -67,18 +67,18 @@ describe('describe hooks - no subtests', () => {
6767}));
6868beforeEach(common.mustNotCall());
6969afterEach(common.mustNotCall());
70-});
70+}));
71717272describe('before throws', () => {
7373before(() => { throw new Error('before'); });
7474it('1', () => {});
7575test('2', () => {});
7676});
777778-describe('before throws - no subtests', () => {
78+describe('before throws - no subtests', common.mustCall(() => {
7979before(() => { throw new Error('before'); });
8080after(common.mustCall());
81-});
81+}));
82828383describe('after throws', () => {
8484after(() => { throw new Error('after'); });
@@ -102,11 +102,11 @@ describe('afterEach throws', () => {
102102test('2', () => {});
103103});
104104105-describe('afterEach when test fails', () => {
105+describe('afterEach when test fails', common.mustCall(() => {
106106afterEach(common.mustCall(2));
107107it('1', () => { throw new Error('test'); });
108108test('2', () => {});
109-});
109+}));
110110111111describe('afterEach throws and test fails', () => {
112112afterEach(() => { throw new Error('afterEach'); });
@@ -246,13 +246,13 @@ test('t.after() is called if test body throws', (t) => {
246246throw new Error('bye');
247247});
248248249-describe('run after when before throws', () => {
249+describe('run after when before throws', common.mustCall(() => {
250250after(common.mustCall(() => {
251251console.log('- after() called');
252252}));
253253before(() => { throw new Error('before'); });
254254it('1', () => {});
255-});
255+}));
256256257257258258test('test hooks - async', async (t) => {