@@ -10,21 +10,10 @@ const fixtures = require('../common/fixtures');
1010const envSuffix = common . isWindows ? '-windows' : '' ;
1111
1212describe ( '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-
2413 it ( 'returns error on non-existent file' , async ( ) => {
2514 const child = await common . spawnPromisified (
2615 process . execPath ,
27- [ '--no-warnings' , '-- run', 'test' ] ,
16+ [ '--run' , 'test' ] ,
2817 { cwd : __dirname } ,
2918 ) ;
3019 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]', () => {
4837 it ( 'adds node_modules/.bin to path' , async ( ) => {
4938 const child = await common . spawnPromisified (
5039 process . execPath ,
51- [ '--no-warnings' , '-- run', `ada${ envSuffix } ` ] ,
40+ [ '--run' , `ada${ envSuffix } ` ] ,
5241 { cwd : fixtures . path ( 'run-script' ) } ,
5342 ) ;
5443 assert . match ( child . stdout , / 0 6 0 6 2 0 2 3 / ) ;
@@ -59,7 +48,7 @@ describe('node --run [command]', () => {
5948 it ( 'chdirs into package directory' , async ( ) => {
6049 const child = await common . spawnPromisified (
6150 process . execPath ,
62- [ '--no-warnings' , '-- run', `pwd${ envSuffix } ` ] ,
51+ [ '--run' , `pwd${ envSuffix } ` ] ,
6352 { cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
6453 ) ;
6554 assert . strictEqual ( child . stdout . trim ( ) , fixtures . path ( 'run-script' ) ) ;
@@ -71,7 +60,7 @@ describe('node --run [command]', () => {
7160 {
7261 const child = await common . spawnPromisified (
7362 process . execPath ,
74- [ '--no-warnings' , '-- run', 'missing' ] ,
63+ [ '--run' , 'missing' ] ,
7564 { cwd : fixtures . path ( 'run-script' ) } ,
7665 ) ;
7766 assert . strictEqual ( child . stdout , '' ) ;
@@ -82,7 +71,7 @@ describe('node --run [command]', () => {
8271 {
8372 const child = await common . spawnPromisified (
8473 process . execPath ,
85- [ '--no-warnings' , '-- run', 'test' ] ,
74+ [ '--run' , 'test' ] ,
8675 { cwd : fixtures . path ( 'run-script/missing-scripts' ) } ,
8776 ) ;
8877 assert . strictEqual ( child . stdout , '' ) ;
@@ -92,7 +81,7 @@ describe('node --run [command]', () => {
9281 {
9382 const child = await common . spawnPromisified (
9483 process . execPath ,
95- [ '--no-warnings' , '-- run', 'test' ] ,
84+ [ '--run' , 'test' ] ,
9685 { cwd : fixtures . path ( 'run-script/invalid-json' ) } ,
9786 ) ;
9887 assert . strictEqual ( child . stdout , '' ) ;
@@ -102,7 +91,7 @@ describe('node --run [command]', () => {
10291 {
10392 const child = await common . spawnPromisified (
10493 process . execPath ,
105- [ '--no-warnings' , '-- run', 'array' ] ,
94+ [ '--run' , 'array' ] ,
10695 { cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
10796 ) ;
10897 assert . strictEqual ( child . stdout , '' ) ;
@@ -112,7 +101,7 @@ describe('node --run [command]', () => {
112101 {
113102 const child = await common . spawnPromisified (
114103 process . execPath ,
115- [ '--no-warnings' , '-- run', 'boolean' ] ,
104+ [ '--run' , 'boolean' ] ,
116105 { cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
117106 ) ;
118107 assert . strictEqual ( child . stdout , '' ) ;
@@ -122,7 +111,7 @@ describe('node --run [command]', () => {
122111 {
123112 const child = await common . spawnPromisified (
124113 process . execPath ,
125- [ '--no-warnings' , '-- run', 'null' ] ,
114+ [ '--run' , 'null' ] ,
126115 { cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
127116 ) ;
128117 assert . strictEqual ( child . stdout , '' ) ;
@@ -132,7 +121,7 @@ describe('node --run [command]', () => {
132121 {
133122 const child = await common . spawnPromisified (
134123 process . execPath ,
135- [ '--no-warnings' , '-- run', 'number' ] ,
124+ [ '--run' , 'number' ] ,
136125 { cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
137126 ) ;
138127 assert . strictEqual ( child . stdout , '' ) ;
@@ -142,7 +131,7 @@ describe('node --run [command]', () => {
142131 {
143132 const child = await common . spawnPromisified (
144133 process . execPath ,
145- [ '--no-warnings' , '-- run', 'object' ] ,
134+ [ '--run' , 'object' ] ,
146135 { cwd : fixtures . path ( 'run-script/invalid-schema' ) } ,
147136 ) ;
148137 assert . strictEqual ( child . stdout , '' ) ;
@@ -154,7 +143,7 @@ describe('node --run [command]', () => {
154143 it ( 'appends positional arguments' , async ( ) => {
155144 const child = await common . spawnPromisified (
156145 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' ] ,
158147 { cwd : fixtures . path ( 'run-script' ) } ,
159148 ) ;
160149 if ( common . isWindows ) {
@@ -170,7 +159,7 @@ describe('node --run [command]', () => {
170159 it ( 'should set PATH environment variable with paths appended with node_modules/.bin' , async ( ) => {
171160 const child = await common . spawnPromisified (
172161 process . execPath ,
173- [ '--no-warnings' , '-- run', `path-env${ envSuffix } ` ] ,
162+ [ '--run' , `path-env${ envSuffix } ` ] ,
174163 { cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
175164 ) ;
176165 assert . ok ( child . stdout . includes ( fixtures . path ( 'run-script/node_modules/.bin' ) ) ) ;
@@ -191,7 +180,7 @@ describe('node --run [command]', () => {
191180 const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
192181 const child = await common . spawnPromisified (
193182 process . execPath ,
194- [ '--no-warnings' , '-- run', scriptName ] ,
183+ [ '--run' , scriptName ] ,
195184 { cwd : fixtures . path ( 'run-script' ) } ,
196185 ) ;
197186 assert . ok ( child . stdout . includes ( scriptName ) ) ;
@@ -204,7 +193,7 @@ describe('node --run [command]', () => {
204193 const packageJsonPath = fixtures . path ( 'run-script/package.json' ) ;
205194 const child = await common . spawnPromisified (
206195 process . execPath ,
207- [ '--no-warnings' , '-- run', `special-env-variables${ envSuffix } ` ] ,
196+ [ '--run' , `special-env-variables${ envSuffix } ` ] ,
208197 { cwd : fixtures . path ( 'run-script/sub-directory' ) } ,
209198 ) ;
210199 assert . ok ( child . stdout . includes ( packageJsonPath ) ) ;
@@ -215,7 +204,7 @@ describe('node --run [command]', () => {
215204 it ( 'returns error on unparsable file' , async ( ) => {
216205 const child = await common . spawnPromisified (
217206 process . execPath ,
218- [ '--no-warnings' , '-- run', 'test' ] ,
207+ [ '--run' , 'test' ] ,
219208 { cwd : fixtures . path ( 'run-script/cannot-parse' ) } ,
220209 ) ;
221210 assert . match ( child . stderr , / C a n ' t p a r s e / ) ;
@@ -226,7 +215,7 @@ describe('node --run [command]', () => {
226215 it ( 'returns error when there is no "scripts" field file' , async ( ) => {
227216 const child = await common . spawnPromisified (
228217 process . execPath ,
229- [ '--no-warnings' , '-- run', 'test' ] ,
218+ [ '--run' , 'test' ] ,
230219 { cwd : fixtures . path ( 'run-script/cannot-find-script' ) } ,
231220 ) ;
232221 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