diff options
author | Rich Trott <rtrott@gmail.com> | 2017-06-24 15:47:38 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-06-28 19:43:13 -0700 |
commit | 99dc9d03deb4838ceaa7abb39a7a4dfa12c89ce9 (patch) | |
tree | 22beffaa53af2ea13e5df6ddc4a2453beb81ffb5 /test/parallel/test-vm-sigint.js | |
parent | 62947916b6227b0a41f87b0d49e26586704e8e42 (diff) | |
download | android-node-v8-99dc9d03deb4838ceaa7abb39a7a4dfa12c89ce9.tar.gz android-node-v8-99dc9d03deb4838ceaa7abb39a7a4dfa12c89ce9.tar.bz2 android-node-v8-99dc9d03deb4838ceaa7abb39a7a4dfa12c89ce9.zip |
test: refactor test-vm-sigint
* Use common.mustNotCall() to confirm SIGINT listeners are not being
invoked.
* Improve assertion check on integer child argument.
* Add blank line per test writing guide.
PR-URL: https://github.com/nodejs/node/pull/13902
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-vm-sigint.js')
-rw-r--r-- | test/parallel/test-vm-sigint.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/parallel/test-vm-sigint.js b/test/parallel/test-vm-sigint.js index 4d93ec32c0..b1ad616405 100644 --- a/test/parallel/test-vm-sigint.js +++ b/test/parallel/test-vm-sigint.js @@ -1,5 +1,6 @@ 'use strict'; const common = require('../common'); + const assert = require('assert'); const vm = require('vm'); @@ -15,7 +16,7 @@ if (process.argv[2] === 'child') { const method = process.argv[3]; const listeners = +process.argv[4]; assert.ok(method); - assert.ok(typeof listeners, 'number'); + assert.ok(Number.isInteger(listeners)); const script = `process.send('${method}'); while(true) {}`; const args = method === 'runInContext' ? @@ -24,7 +25,7 @@ if (process.argv[2] === 'child') { const options = { breakOnSigint: true }; for (let i = 0; i < listeners; i++) - process.on('SIGINT', common.noop); + process.on('SIGINT', common.mustNotCall()); assert.throws(() => { vm[method](script, ...args, options); }, /^Error: Script execution interrupted\.$/); |