Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: refactor assert.equal, update syntax to ES6
  • Loading branch information
Prieto, Marcos
Prieto, Marcos committed Dec 1, 2016
commit 07e622136f8d1fed135b8719564c608079afa31f
18 changes: 9 additions & 9 deletions test/parallel/test-child-process-stdio-inherit.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
'use strict';
var common = require('../common');
var assert = require('assert');
var spawn = require('child_process').spawn;
const common = require('../common');
const assert = require('assert');
const spawn = require('child_process').spawn;

if (process.argv[2] === 'parent')
parent();
else
grandparent();

function grandparent() {
var child = spawn(process.execPath, [__filename, 'parent']);
let child = spawn(process.execPath, [__filename, 'parent']);
child.stderr.pipe(process.stderr);
var output = '';
var input = 'asdfasdf';
let output = '';
const input = 'asdfasdf';

child.stdout.on('data', function(chunk) {
output += chunk;
Expand All @@ -22,10 +22,10 @@ function grandparent() {
child.stdin.end(input);

child.on('close', function(code, signal) {
assert.equal(code, 0);
assert.equal(signal, null);
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
// cat on windows adds a \r\n at the end.
assert.equal(output.trim(), input.trim());
assert.strictEqual(output.trim(), input.trim());
});
}

Expand Down