Skip to content

Commit

Permalink
test: fix ELIFECYCLE
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Mar 3, 2019
1 parent c38f748 commit 8e68ea0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/70_user32.test.ts
Expand Up @@ -65,8 +65,6 @@ describe(filename, () => {
done()
},
() => {
// tslint:disable-next-line:no-unused-expression
typeof enumWindowsProc // avoid gc
child.kill()
done()
},
Expand Down Expand Up @@ -107,10 +105,15 @@ function createEnumWinProc(): M.WNDENUMPROC {
},
)

process.on('exit', () => {
// tslint:disable-next-line:no-unused-expression
typeof enumWindowsProc // avoid gc
})

return enumWindowsProc
}


function enumWindows(proc: M.WNDENUMPROC, id: number): void {
user32.EnumWindows(proc , id)
user32.EnumWindows(proc, id)
}
5 changes: 5 additions & 0 deletions test/helper.ts
Expand Up @@ -41,6 +41,11 @@ export function createWndProc(): M.WNDPROC {
},
)

process.on('exit', () => {
// tslint:disable-next-line:no-unused-expression
WndProc // avoid gc
})

return WndProc
}

Expand Down

0 comments on commit 8e68ea0

Please sign in to comment.