test: modernize JS and tighten equality checking
Changed var --> const and let. Changed assert.equal !== --> assert.notStrictEqual Correctly aligned argument PR-URL: https://github.com/nodejs/node/pull/8580 Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
fe69d0d0a4
commit
d59074c1cb
@ -1,21 +1,21 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
var common = require('../common');
|
const common = require('../common');
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
var path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
var spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
var childPath = path.join(common.fixturesDir,
|
const childPath = path.join(common.fixturesDir,
|
||||||
'parent-process-nonpersistent.js');
|
'parent-process-nonpersistent.js');
|
||||||
var persistentPid = -1;
|
let persistentPid = -1;
|
||||||
|
|
||||||
var child = spawn(process.execPath, [ childPath ]);
|
const child = spawn(process.execPath, [ childPath ]);
|
||||||
|
|
||||||
child.stdout.on('data', function(data) {
|
child.stdout.on('data', function(data) {
|
||||||
persistentPid = parseInt(data, 10);
|
persistentPid = parseInt(data, 10);
|
||||||
});
|
});
|
||||||
|
|
||||||
process.on('exit', function() {
|
process.on('exit', function() {
|
||||||
assert(persistentPid !== -1);
|
assert.notStrictEqual(persistentPid, -1);
|
||||||
assert.throws(function() {
|
assert.throws(function() {
|
||||||
process.kill(child.pid);
|
process.kill(child.pid);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user