test: add regression test for test_runner after hook

Refs: https://github.com/nodejs/node/issues/51997
PR-URL: https://github.com/nodejs/node/pull/51998
Fixes: https://github.com/nodejs/node/issues/51997
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
cjihrig authored and Node.js GitHub Bot committed 2024-03-07 09:16:37 +00:00
1 parent 0e8070d4f2
commit 3aa06589f1
1 file changed
+12
@@ -0,0 +1,12 @@
'use strict';
const common = require('../common');
const { test } = require('node:test');
// Regression test for https://github.com/nodejs/node/issues/51997
test('after hook should be called with no subtests', (t) => {
const timer = setTimeout(common.mustNotCall(), 2 ** 30);
t.after(common.mustCall(() => {
clearTimeout(timer);
}));
});