mirror of
https://github.com/nodejs/node.git
synced 2025-05-05 07:27:49 +00:00

This updates a lot of comments. PR-URL: https://github.com/nodejs/node/pull/26223 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
27 lines
679 B
JavaScript
27 lines
679 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
|
|
const node = process.execPath;
|
|
|
|
// Test both sets of arguments that check syntax
|
|
const syntaxArgs = [
|
|
['-c'],
|
|
['--check']
|
|
];
|
|
|
|
// Should not execute code piped from stdin with --check.
|
|
// Loop each possible option, `-c` or `--check`.
|
|
syntaxArgs.forEach(function(args) {
|
|
const stdin = 'throw new Error("should not get run");';
|
|
const c = spawnSync(node, args, { encoding: 'utf8', input: stdin });
|
|
|
|
// no stdout or stderr should be produced
|
|
assert.strictEqual(c.stdout, '');
|
|
assert.strictEqual(c.stderr, '');
|
|
|
|
assert.strictEqual(c.status, 0);
|
|
});
|