Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: cleanup test-child-process-stdio.js #8584

Closed
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
8 changes: 4 additions & 4 deletions test/parallel/test-child-process-stdio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

var options = {stdio: ['pipe']};
var child = common.spawnPwd(options);
let options = {stdio: ['pipe']};
let child = common.spawnPwd(options);

assert.notEqual(child.stdout, null);
assert.notEqual(child.stderr, null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change assert.notStrictEqual and assert.strictEqual in this test file, too :)

Copy link
Author

@pmatzavin pmatzavin Sep 18, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax If i understood that correctly:

Do you mean that i should replace equal with strictEqual and replace notEqual with notStrictEqual ?

In that case will there be any inconsistencies because of the fact that the assertions in this file are against null and:
undefined === null // equals false
undefined !== null // equals true

For example:
assert.notStrictEqual(undefined, null) // this will pass
assert.strictEqual(undefined, null) // this will not pass

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmatzavin Sorry for the late reply! Yes, that’s what I meant. Just to be clear, notStrictEqual corresponds to !== and strictEqual to ===, and we usually do want the strict tests exactly to catch things like accidentally relying on undefined == null.

Expand Down