@@ -10,21 +10,10 @@ const fixtures = require('../common/fixtures');
10
10
const envSuffix = common . isWindows ? '-windows' : '' ;
11
11
12
12
describe ( 'node --run [command]' , ( ) => {
13
- it ( 'should emit experimental warning' , async ( ) => {
14
- const child = await common . spawnPromisified (
15
- process . execPath ,
16
- [ '--run' , 'test' ] ,
17
- { cwd : __dirname } ,
18
- ) ;
19
- 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 / ) ;
20
- assert . strictEqual ( child . stdout , '' ) ;
21
- assert . strictEqual ( child . code , 1 ) ;
22
- } ) ;
23
-
24
13
it ( 'returns error on non-existent file' , async ( ) => {
25
14
const child = await common . spawnPromisified (
26
15
process . execPath ,
27
- [ '--no-warnings' , '-- run', 'test' ] ,
16
+ [ '--run' , 'test' ] ,
28
17
{ cwd : __dirname } ,
29
18
) ;
30
19
assert . match ( child . stderr , / C a n ' t f i n d p a c k a g e \. j s o n [ \s \S ] * / ) ;
@@ -48,7 +37,7 @@ describe('node --run [command]', () => {
48
37
it ( 'adds node_modules/.bin to path' , async ( ) => {
49
38
const child = await common . spawnPromisified (
50
39
process . execPath ,
51
- [ '--no-warnings' , '-- run', `ada${ envSuffix } ` ] ,
40
+ [ '--run' , `ada${ envSuffix } ` ] ,
52
41
{ cwd : fixtures . path ( 'run-script' ) } ,
53
42
) ;
54
43
assert . match ( child . stdout , / 0 6 0 6 2 0 2 3 / ) ;
@@ -59,7 +48,7 @@ describe('node --run [command]', () => {
59
48
it ( 'chdirs into package directory' , async ( ) => {
60
49
const child = await common . spawnPromisified (
61
50
process . execPath ,
62
- [ '--no-warnings' , '-- run', `pwd${ envSuffix } ` ] ,
51
+ [ '--run' , `pwd${ envSuffix } ` ] ,
63
52
{ cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
64
53
) ;
65
54
assert . strictEqual ( child . stdout . trim ( ) , fixtures . path ( 'run-script' ) ) ;
@@ -71,7 +60,7 @@ describe('node --run [command]', () => {
71
60
{
72
61
const child = await common . spawnPromisified (
73
62
process . execPath ,
74
- [ '--no-warnings' , '-- run', 'missing' ] ,
63
+ [ '--run' , 'missing' ] ,
75
64
{ cwd : fixtures . path ( 'run-script' ) } ,
76
65
) ;
77
66
assert . strictEqual ( child . stdout , '' ) ;
@@ -82,7 +71,7 @@ describe('node --run [command]', () => {
82
71
{
83
72
const child = await common . spawnPromisified (
84
73
process . execPath ,
85
- [ '--no-warnings' , '-- run', 'test' ] ,
74
+ [ '--run' , 'test' ] ,
86
75
{ cwd : fixtures . path ( 'run-script/missing-scripts' ) } ,
87
76
) ;
88
77
assert . strictEqual ( child . stdout , '' ) ;
@@ -92,7 +81,7 @@ describe('node --run [command]', () => {
92
81
{
93
82
const child = await common . spawnPromisified (
94
83
process . execPath ,
95
- [ '--no-warnings' , '-- run', 'test' ] ,
84
+ [ '--run' , 'test' ] ,
96
85
{ cwd : fixtures . path ( 'run-script/invalid-json' ) } ,
97
86
) ;
98
87
assert . strictEqual ( child . stdout , '' ) ;
@@ -102,7 +91,7 @@ describe('node --run [command]', () => {
102
91
{
103
92
const child = await common . spawnPromisified (
104
93
process . execPath ,
105
- [ '--no-warnings' , '-- run', 'array' ] ,
94
+ [ '--run' , 'array' ] ,
106
95
{ cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
107
96
) ;
108
97
assert . strictEqual ( child . stdout , '' ) ;
@@ -112,7 +101,7 @@ describe('node --run [command]', () => {
112
101
{
113
102
const child = await common . spawnPromisified (
114
103
process . execPath ,
115
- [ '--no-warnings' , '-- run', 'boolean' ] ,
104
+ [ '--run' , 'boolean' ] ,
116
105
{ cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
117
106
) ;
118
107
assert . strictEqual ( child . stdout , '' ) ;
@@ -122,7 +111,7 @@ describe('node --run [command]', () => {
122
111
{
123
112
const child = await common . spawnPromisified (
124
113
process . execPath ,
125
- [ '--no-warnings' , '-- run', 'null' ] ,
114
+ [ '--run' , 'null' ] ,
126
115
{ cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
127
116
) ;
128
117
assert . strictEqual ( child . stdout , '' ) ;
@@ -132,7 +121,7 @@ describe('node --run [command]', () => {
132
121
{
133
122
const child = await common . spawnPromisified (
134
123
process . execPath ,
135
- [ '--no-warnings' , '-- run', 'number' ] ,
124
+ [ '--run' , 'number' ] ,
136
125
{ cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
137
126
) ;
138
127
assert . strictEqual ( child . stdout , '' ) ;
@@ -142,7 +131,7 @@ describe('node --run [command]', () => {
142
131
{
143
132
const child = await common . spawnPromisified (
144
133
process . execPath ,
145
- [ '--no-warnings' , '-- run', 'object' ] ,
134
+ [ '--run' , 'object' ] ,
146
135
{ cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
147
136
) ;
148
137
assert . strictEqual ( child . stdout , '' ) ;
@@ -154,7 +143,7 @@ describe('node --run [command]', () => {
154
143
it ( 'appends positional arguments' , async ( ) => {
155
144
const child = await common . spawnPromisified (
156
145
process . execPath ,
157
- [ '--no-warnings' , '-- run', `positional-args${ envSuffix } ` , '--' , '--help "hello world test"' , 'A' , 'B' , 'C' ] ,
146
+ [ '--run' , `positional-args${ envSuffix } ` , '--' , '--help "hello world test"' , 'A' , 'B' , 'C' ] ,
158
147
{ cwd : fixtures . path ( 'run-script' ) } ,
159
148
) ;
160
149
if ( common . isWindows ) {
@@ -170,7 +159,7 @@ describe('node --run [command]', () => {
170
159
it ( 'should set PATH environment variable with paths appended with node_modules/.bin' , async ( ) => {
171
160
const child = await common . spawnPromisified (
172
161
process . execPath ,
173
- [ '--no-warnings' , '-- run', `path-env${ envSuffix } ` ] ,
162
+ [ '--run' , `path-env${ envSuffix } ` ] ,
174
163
{ cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
175
164
) ;
176
165
assert . ok ( child . stdout . includes ( fixtures . path ( 'run-script/node_modules/.bin' ) ) ) ;
@@ -191,7 +180,7 @@ describe('node --run [command]', () => {
191
180
const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
192
181
const child = await common . spawnPromisified (
193
182
process . execPath ,
194
- [ '--no-warnings' , '-- run', scriptName ] ,
183
+ [ '--run' , scriptName ] ,
195
184
{ cwd : fixtures . path ( 'run-script' ) } ,
196
185
) ;
197
186
assert . ok ( child . stdout . includes ( scriptName ) ) ;
@@ -204,7 +193,7 @@ describe('node --run [command]', () => {
204
193
const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
205
194
const child = await common . spawnPromisified (
206
195
process . execPath ,
207
- [ '--no-warnings' , '-- run', `special-env-variables${ envSuffix } ` ] ,
196
+ [ '--run' , `special-env-variables${ envSuffix } ` ] ,
208
197
{ cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
209
198
) ;
210
199
assert . ok ( child . stdout . includes ( packageJsonPath ) ) ;
@@ -215,7 +204,7 @@ describe('node --run [command]', () => {
215
204
it ( 'returns error on unparsable file' , async ( ) => {
216
205
const child = await common . spawnPromisified (
217
206
process . execPath ,
218
- [ '--no-warnings' , '-- run', 'test' ] ,
207
+ [ '--run' , 'test' ] ,
219
208
{ cwd : fixtures . path ( 'run-script/cannot-parse' ) } ,
220
209
) ;
221
210
assert . match ( child . stderr , / C a n ' t p a r s e / ) ;
@@ -226,7 +215,7 @@ describe('node --run [command]', () => {
226
215
it ( 'returns error when there is no "scripts" field file' , async ( ) => {
227
216
const child = await common . spawnPromisified (
228
217
process . execPath ,
229
- [ '--no-warnings' , '-- run', 'test' ] ,
218
+ [ '--run' , 'test' ] ,
230
219
{ cwd : fixtures . path ( 'run-script/cannot-find-script' ) } ,
231
220
) ;
232
221
assert . match ( child . stderr , / C a n ' t f i n d " s c r i p t s " f i e l d i n / ) ;
0 commit comments