Skip to content

Commit 85aa6ca

Browse files
cjihrigtargos
authored andcommitted
Revert "test_runner: do not invoke after hook when test is empty"
This reverts commit a53fd95. This caused a regression because the original issue this commit was attempting to fix is not a bug. The after() hook should always run. Fixes: #51997 PR-URL: #51998 Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 7ff3551 commit 85aa6ca

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

‎lib/internal/test_runner/test.js‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,7 @@ class Test extends AsyncResource{
595595

596596
const{ args, ctx }=this.getRunArgs();
597597
constafter=async()=>{
598-
// If its a root test then check for global after hook else check for parent after hook
599-
constcheck=this.parent ? this.parent.hooks.after.length>0 : this.hooks.after.length>0;
600-
if(check){
598+
if(this.hooks.after.length>0){
601599
awaitthis.runHook('after',{__proto__: null, args, ctx });
602600
}
603601
};

‎test/parallel/test-runner-skip-after-hook.js‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
(0)