Skip to content

Commit 1468382

Browse files
committed
src: mark node --run as stable
1 parent 4fe0f82 commit 1468382

File tree

3 files changed

+7
-27
lines changed

3 files changed

+7
-27
lines changed

doc/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ changes:
20092009
`PATH` environment variable accordingly.
20102010
-->
20112011

2012-
> Stability: 1.2 - Release candidate
2012+
> Stability: 2 - Stable
20132013
20142014
This runs a specified command from a package.json's `"scripts"` object.
20152015
If no `"command"` is provided, it will list the available scripts.

src/node.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,14 +1011,6 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
10111011
}
10121012

10131013
if (!per_process::cli_options->run.empty()) {
1014-
// TODO(@anonrig): Handle NODE_NO_WARNINGS, NODE_REDIRECT_WARNINGS,
1015-
// --disable-warning and --redirect-warnings.
1016-
if (per_process::cli_options->per_isolate->per_env->warnings) {
1017-
fprintf(stderr,
1018-
"ExperimentalWarning: Task runner is an experimental feature and "
1019-
"might change at any time\n\n");
1020-
}
1021-
10221014
auto positional_args = task_runner::GetPositionalArgs(args);
10231015
result->early_return_ = true;
10241016
task_runner::RunTask(

test/parallel/test-node-run.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,10 @@ const fixtures = require('../common/fixtures');
88
const envSuffix = common.isWindows ? '-windows' : '';
99

1010
describe('node --run [command]', () => {
11-
it('should emit experimental warning', async () => {
12-
const child = await common.spawnPromisified(
13-
process.execPath,
14-
[ '--run', 'test'],
15-
{ cwd: __dirname },
16-
);
17-
assert.match(child.stderr, /ExperimentalWarning: Task runner is an experimental feature and might change at any time/);
18-
assert.match(child.stderr, /Can't read package\.json/);
19-
assert.strictEqual(child.stdout, '');
20-
assert.strictEqual(child.code, 1);
21-
});
22-
2311
it('returns error on non-existent file', async () => {
2412
const child = await common.spawnPromisified(
2513
process.execPath,
26-
[ '--no-warnings', '--run', 'test'],
14+
[ '--run', 'test'],
2715
{ cwd: __dirname },
2816
);
2917
assert.match(child.stderr, /Can't read package\.json/);
@@ -45,7 +33,7 @@ describe('node --run [command]', () => {
4533
it('adds node_modules/.bin to path', async () => {
4634
const child = await common.spawnPromisified(
4735
process.execPath,
48-
[ '--no-warnings', '--run', `ada${envSuffix}`],
36+
[ '--run', `ada${envSuffix}`],
4937
{ cwd: fixtures.path('run-script') },
5038
);
5139
assert.match(child.stdout, /06062023/);
@@ -56,7 +44,7 @@ describe('node --run [command]', () => {
5644
it('appends positional arguments', async () => {
5745
const child = await common.spawnPromisified(
5846
process.execPath,
59-
[ '--no-warnings', '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C'],
47+
[ '--run', `positional-args${envSuffix}`, '--', '--help "hello world test"', 'A', 'B', 'C'],
6048
{ cwd: fixtures.path('run-script') },
6149
);
6250
if (common.isWindows) {
@@ -72,7 +60,7 @@ describe('node --run [command]', () => {
7260
it('should set PATH environment variable with paths appended with node_modules/.bin', async () => {
7361
const child = await common.spawnPromisified(
7462
process.execPath,
75-
[ '--no-warnings', '--run', `path-env${envSuffix}`],
63+
[ '--run', `path-env${envSuffix}`],
7664
{ cwd: fixtures.path('run-script/sub-directory') },
7765
);
7866
assert.ok(child.stdout.includes(fixtures.path('run-script/node_modules/.bin')));
@@ -93,7 +81,7 @@ describe('node --run [command]', () => {
9381
const packageJsonPath = fixtures.path('run-script/package.json');
9482
const child = await common.spawnPromisified(
9583
process.execPath,
96-
[ '--no-warnings', '--run', scriptName],
84+
[ '--run', scriptName],
9785
{ cwd: fixtures.path('run-script') },
9886
);
9987
assert.ok(child.stdout.includes(scriptName));
@@ -106,7 +94,7 @@ describe('node --run [command]', () => {
10694
const packageJsonPath = fixtures.path('run-script/package.json');
10795
const child = await common.spawnPromisified(
10896
process.execPath,
109-
[ '--no-warnings', '--run', `special-env-variables${envSuffix}`],
97+
[ '--run', `special-env-variables${envSuffix}`],
11098
{ cwd: fixtures.path('run-script/sub-directory') },
11199
);
112100
assert.ok(child.stdout.includes(packageJsonPath));

0 commit comments

Comments
 (0)