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 6a8afee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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)
}
2 changes: 0 additions & 2 deletions test/90_loop_callback.test.ts
Expand Up @@ -67,8 +67,6 @@ describe(filename, () => {
const end = new Date().getTime()
const delta = end - start
console.info(`elp ${delta}ms at ${loops} loops`)
// tslint:disable-next-line:no-unused-expression
typeof wndProc // avoid gc
},
)

Expand Down
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 6a8afee

Please sign in to comment.