Skip to content

Commit

Permalink
test: modernize JS and tighten equality checking
Browse files Browse the repository at this point in the history
Changed var --> const and let.
Changed assert.equal !== --> assert.notStrictEqual
Correctly aligned argument

PR-URL: #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>
  • Loading branch information
wzoom authored and addaleax committed Sep 20, 2016
1 parent fe69d0d commit d59074c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/parallel/test-child-process-detached.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var path = require('path');
const common = require('../common');
const assert = require('assert');
const path = require('path');

var spawn = require('child_process').spawn;
var childPath = path.join(common.fixturesDir,
'parent-process-nonpersistent.js');
var persistentPid = -1;
const spawn = require('child_process').spawn;
const childPath = path.join(common.fixturesDir,
'parent-process-nonpersistent.js');
let persistentPid = -1;

var child = spawn(process.execPath, [ childPath ]);
const child = spawn(process.execPath, [ childPath ]);

child.stdout.on('data', function(data) {
persistentPid = parseInt(data, 10);
});

process.on('exit', function() {
assert(persistentPid !== -1);
assert.notStrictEqual(persistentPid, -1);
assert.throws(function() {
process.kill(child.pid);
});
Expand Down

0 comments on commit d59074c

Please sign in to comment.