diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index ee2c345e7a0403..f24d74ac69f9f7 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -595,9 +595,7 @@ class Test extends AsyncResource { const { args, ctx } = this.getRunArgs(); const after = async () => { - // If its a root test then check for global after hook else check for parent after hook - const check = this.parent ? this.parent.hooks.after.length > 0 : this.hooks.after.length > 0; - if (check) { + if (this.hooks.after.length > 0) { await this.runHook('after', { __proto__: null, args, ctx }); } }; diff --git a/test/parallel/test-runner-skip-after-hook.js b/test/parallel/test-runner-skip-after-hook.js deleted file mode 100644 index d8175135b02f0d..00000000000000 --- a/test/parallel/test-runner-skip-after-hook.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; -// Refs: https://github.com/nodejs/node/issues/51371 -const common = require('../common'); -const { test } = require('node:test'); - -test('test', async (t) => { - t.after(common.mustNotCall(() => { - t.fail('should not run'); - })); -});