Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit f9cfd70

Browse files
committed
test: fix bad test in test-cli-eval.js
The test checked that stdout was empty. Forgetting to escape brackets in the argument to --eval made that true on UNIX systems: the error was written to stderr. Props to Peter Bright for reporting the issue.
1 parent 0c4e735 commit f9cfd70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/simple/test-cli-eval.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ child.exec(nodejs + ' --eval 42',
3636
assert.equal(stdout, '');
3737
});
3838

39-
// assert that nothing is written to stdout
40-
child.exec(nodejs + ' --eval console.log(42)',
39+
// assert that "42\n" is written to stderr
40+
child.exec(nodejs + ' --eval \'console.error(42)\'',
4141
function(err, stdout, stderr) {
42-
assert.equal(stdout, '');
42+
assert.equal(stderr, "42\n");
4343
});
4444

4545
// assert that module loading works

0 commit comments

Comments
 (0)