@@ -8,22 +8,10 @@ const fixtures = require('../common/fixtures');
8
8
const envSuffix = common . isWindows ? '-windows' : '' ;
9
9
10
10
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 , / E x p e r i m e n t a l W a r n i n g : T a s k r u n n e r i s a n e x p e r i m e n t a l f e a t u r e a n d m i g h t c h a n g e a t a n y t i m e / ) ;
18
- assert . match ( child . stderr , / C a n ' t r e a d p a c k a g e \. j s o n / ) ;
19
- assert . strictEqual ( child . stdout , '' ) ;
20
- assert . strictEqual ( child . code , 1 ) ;
21
- } ) ;
22
-
23
11
it ( 'returns error on non-existent file' , async ( ) => {
24
12
const child = await common . spawnPromisified (
25
13
process . execPath ,
26
- [ '--no-warnings' , '-- run', 'test' ] ,
14
+ [ '--run' , 'test' ] ,
27
15
{ cwd : __dirname } ,
28
16
) ;
29
17
assert . match ( child . stderr , / C a n ' t r e a d p a c k a g e \. j s o n / ) ;
@@ -45,7 +33,7 @@ describe('node --run [command]', () => {
45
33
it ( 'adds node_modules/.bin to path' , async ( ) => {
46
34
const child = await common . spawnPromisified (
47
35
process . execPath ,
48
- [ '--no-warnings' , '-- run', `ada${ envSuffix } ` ] ,
36
+ [ '--run' , `ada${ envSuffix } ` ] ,
49
37
{ cwd : fixtures . path ( 'run-script' ) } ,
50
38
) ;
51
39
assert . match ( child . stdout , / 0 6 0 6 2 0 2 3 / ) ;
@@ -56,7 +44,7 @@ describe('node --run [command]', () => {
56
44
it ( 'appends positional arguments' , async ( ) => {
57
45
const child = await common . spawnPromisified (
58
46
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' ] ,
60
48
{ cwd : fixtures . path ( 'run-script' ) } ,
61
49
) ;
62
50
if ( common . isWindows ) {
@@ -72,7 +60,7 @@ describe('node --run [command]', () => {
72
60
it ( 'should set PATH environment variable with paths appended with node_modules/.bin' , async ( ) => {
73
61
const child = await common . spawnPromisified (
74
62
process . execPath ,
75
- [ '--no-warnings' , '-- run', `path-env${ envSuffix } ` ] ,
63
+ [ '--run' , `path-env${ envSuffix } ` ] ,
76
64
{ cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
77
65
) ;
78
66
assert . ok ( child . stdout . includes ( fixtures . path ( 'run-script/node_modules/.bin' ) ) ) ;
@@ -93,7 +81,7 @@ describe('node --run [command]', () => {
93
81
const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
94
82
const child = await common . spawnPromisified (
95
83
process . execPath ,
96
- [ '--no-warnings' , '-- run', scriptName ] ,
84
+ [ '--run' , scriptName ] ,
97
85
{ cwd : fixtures . path ( 'run-script' ) } ,
98
86
) ;
99
87
assert . ok ( child . stdout . includes ( scriptName ) ) ;
@@ -106,7 +94,7 @@ describe('node --run [command]', () => {
106
94
const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
107
95
const child = await common . spawnPromisified (
108
96
process . execPath ,
109
- [ '--no-warnings' , '-- run', `special-env-variables${ envSuffix } ` ] ,
97
+ [ '--run' , `special-env-variables${ envSuffix } ` ] ,
110
98
{ cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
111
99
) ;
112
100
assert . ok ( child . stdout . includes ( packageJsonPath ) ) ;
0 commit comments