Browse Source

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>
v7.x
Pavol Otcenas 8 years ago
committed by Anna Henningsen
parent
commit
d59074c1cb
No known key found for this signature in database GPG Key ID: D8B9F5AEAE84E4CF
  1. 18
      test/parallel/test-child-process-detached.js

18
test/parallel/test-child-process-detached.js

@ -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);
});

Loading…
Cancel
Save