@@ -75,59 +75,57 @@ test('--mutex network', async () => {
75
75
76
76
// Windows doesn't have the "echo" utility
77
77
// Since this feature isn't platform-specific, running them on OSX and Linux only should be fine
78
- if ( process . platform !== 'win32' ) {
79
- test ( 'yarn run <script> --opt' , async ( ) => {
80
- const cwd = await makeTemp ( ) ;
78
+ test ( 'yarn run <script> --opt' , async ( ) => {
79
+ const cwd = await makeTemp ( ) ;
81
80
82
- await fs . writeFile (
83
- path . join ( cwd , 'package.json' ) ,
84
- JSON . stringify ( {
85
- scripts : { echo : ' echo' } ,
86
- } ) ,
87
- ) ;
81
+ await fs . writeFile (
82
+ path . join ( cwd , 'package.json' ) ,
83
+ JSON . stringify ( {
84
+ scripts : { echo : ` echo` } ,
85
+ } ) ,
86
+ ) ;
88
87
89
- const command = path . resolve ( __dirname , '../bin/yarn' ) ;
90
- const options = { cwd, env : { YARN_SILENT : 1 } } ;
88
+ const command = path . resolve ( __dirname , '../bin/yarn' ) ;
89
+ const options = { cwd, env : { YARN_SILENT : 1 } } ;
91
90
92
- const { stderr : stderr , stdout : stdout } = execa ( command , [ 'run' , 'echo' , '--opt' ] , options ) ;
91
+ const { stderr : stderr , stdout : stdout } = execa ( command , [ 'run' , 'echo' , '--opt' ] , options ) ;
93
92
94
- const stdoutPromise = misc . consumeStream ( stdout ) ;
95
- const stderrPromise = misc . consumeStream ( stderr ) ;
93
+ const stdoutPromise = misc . consumeStream ( stdout ) ;
94
+ const stderrPromise = misc . consumeStream ( stderr ) ;
96
95
97
- const [ stdoutOutput , stderrOutput ] = await Promise . all ( [ stdoutPromise , stderrPromise ] ) ;
96
+ const [ stdoutOutput , stderrOutput ] = await Promise . all ( [ stdoutPromise , stderrPromise ] ) ;
98
97
99
- expect ( stdoutOutput . toString ( ) . trim ( ) ) . toEqual ( '--opt' ) ;
100
- expect ( stderrOutput . toString ( ) ) . not . toMatch (
101
- / F r o m Y a r n 1 \. 0 o n w a r d s , s c r i p t s d o n ' t r e q u i r e " - - " f o r o p t i o n s t o b e f o r w a r d e d / ,
102
- ) ;
103
- } ) ;
98
+ expect ( stdoutOutput . toString ( ) . trim ( ) ) . toEqual ( '--opt' ) ;
99
+ expect ( stderrOutput . toString ( ) ) . not . toMatch (
100
+ / F r o m Y a r n 1 \. 0 o n w a r d s , s c r i p t s d o n ' t r e q u i r e " - - " f o r o p t i o n s t o b e f o r w a r d e d / ,
101
+ ) ;
102
+ } ) ;
104
103
105
- test ( 'yarn run <script> -- --opt' , async ( ) => {
106
- const cwd = await makeTemp ( ) ;
104
+ test ( 'yarn run <script> -- --opt' , async ( ) => {
105
+ const cwd = await makeTemp ( ) ;
107
106
108
- await fs . writeFile (
109
- path . join ( cwd , 'package.json' ) ,
110
- JSON . stringify ( {
111
- scripts : { echo : ' echo' } ,
112
- } ) ,
113
- ) ;
107
+ await fs . writeFile (
108
+ path . join ( cwd , 'package.json' ) ,
109
+ JSON . stringify ( {
110
+ scripts : { echo : ` echo` } ,
111
+ } ) ,
112
+ ) ;
114
113
115
- const command = path . resolve ( __dirname , '../bin/yarn' ) ;
116
- const options = { cwd, env : { YARN_SILENT : 1 } } ;
114
+ const command = path . resolve ( __dirname , '../bin/yarn' ) ;
115
+ const options = { cwd, env : { YARN_SILENT : 1 } } ;
117
116
118
- const { stderr : stderr , stdout : stdout } = execa ( command , [ 'run' , 'echo' , '--' , '--opt' ] , options ) ;
117
+ const { stderr : stderr , stdout : stdout } = execa ( command , [ 'run' , 'echo' , '--' , '--opt' ] , options ) ;
119
118
120
- const stdoutPromise = misc . consumeStream ( stdout ) ;
121
- const stderrPromise = misc . consumeStream ( stderr ) ;
119
+ const stdoutPromise = misc . consumeStream ( stdout ) ;
120
+ const stderrPromise = misc . consumeStream ( stderr ) ;
122
121
123
- const [ stdoutOutput , stderrOutput ] = await Promise . all ( [ stdoutPromise , stderrPromise ] ) ;
122
+ const [ stdoutOutput , stderrOutput ] = await Promise . all ( [ stdoutPromise , stderrPromise ] ) ;
124
123
125
- expect ( stdoutOutput . toString ( ) . trim ( ) ) . toEqual ( '--opt' ) ;
126
- expect ( stderrOutput . toString ( ) ) . toMatch (
127
- / F r o m Y a r n 1 \. 0 o n w a r d s , s c r i p t s d o n ' t r e q u i r e " - - " f o r o p t i o n s t o b e f o r w a r d e d / ,
128
- ) ;
129
- } ) ;
130
- }
124
+ expect ( stdoutOutput . toString ( ) . trim ( ) ) . toEqual ( '--opt' ) ;
125
+ expect ( stderrOutput . toString ( ) ) . toMatch (
126
+ / F r o m Y a r n 1 \. 0 o n w a r d s , s c r i p t s d o n ' t r e q u i r e " - - " f o r o p t i o n s t o b e f o r w a r d e d / ,
127
+ ) ;
128
+ } ) ;
131
129
132
130
test ( 'cache folder fallback' , async ( ) => {
133
131
const cwd = await makeTemp ( ) ;
0 commit comments