@@ -53,12 +53,12 @@ test('allow commands with spaces and array arguments', async t => {
53
53
} ) ;
54
54
55
55
test ( 'execaCommand()' , async t => {
56
- const { stdout} = await execaCommand ( 'node test/fixtures/ echo.js foo bar' ) ;
56
+ const { stdout} = await execaCommand ( 'echo.js foo bar' ) ;
57
57
t . is ( stdout , 'foo\nbar' ) ;
58
58
} ) ;
59
59
60
60
test ( 'execaCommand() ignores consecutive spaces' , async t => {
61
- const { stdout} = await execaCommand ( 'node test/fixtures/ echo.js foo bar' ) ;
61
+ const { stdout} = await execaCommand ( 'echo.js foo bar' ) ;
62
62
t . is ( stdout , 'foo\nbar' ) ;
63
63
} ) ;
64
64
@@ -68,27 +68,27 @@ test('execaCommand() allows escaping spaces in commands', async t => {
68
68
} ) ;
69
69
70
70
test ( 'execaCommand() allows escaping spaces in arguments' , async t => {
71
- const { stdout} = await execaCommand ( 'node test/fixtures/ echo.js foo\\ bar' ) ;
71
+ const { stdout} = await execaCommand ( 'echo.js foo\\ bar' ) ;
72
72
t . is ( stdout , 'foo bar' ) ;
73
73
} ) ;
74
74
75
75
test ( 'execaCommand() escapes other whitespaces' , async t => {
76
- const { stdout} = await execaCommand ( 'node test/fixtures/ echo.js foo\tbar' ) ;
76
+ const { stdout} = await execaCommand ( 'echo.js foo\tbar' ) ;
77
77
t . is ( stdout , 'foo\tbar' ) ;
78
78
} ) ;
79
79
80
80
test ( 'execaCommand() trims' , async t => {
81
- const { stdout} = await execaCommand ( ' node test/fixtures/ echo.js foo bar ' ) ;
81
+ const { stdout} = await execaCommand ( ' echo.js foo bar ' ) ;
82
82
t . is ( stdout , 'foo\nbar' ) ;
83
83
} ) ;
84
84
85
85
test ( 'execaCommandSync()' , t => {
86
- const { stdout} = execaCommandSync ( 'node test/fixtures/ echo.js foo bar' ) ;
86
+ const { stdout} = execaCommandSync ( 'echo.js foo bar' ) ;
87
87
t . is ( stdout , 'foo\nbar' ) ;
88
88
} ) ;
89
89
90
90
test ( '$' , async t => {
91
- const { stdout} = await $ `node test/fixtures/ echo.js foo bar` ;
91
+ const { stdout} = await $ `echo.js foo bar` ;
92
92
t . is ( stdout , 'foo\nbar' ) ;
93
93
} ) ;
94
94
@@ -98,76 +98,76 @@ test('$ accepts options', async t => {
98
98
} ) ;
99
99
100
100
test ( '$ allows string interpolation' , async t => {
101
- const { stdout} = await $ `node test/fixtures/ echo.js foo ${ 'bar' } ` ;
101
+ const { stdout} = await $ `echo.js foo ${ 'bar' } ` ;
102
102
t . is ( stdout , 'foo\nbar' ) ;
103
103
} ) ;
104
104
105
105
test ( '$ allows number interpolation' , async t => {
106
- const { stdout} = await $ `node test/fixtures/ echo.js 1 ${ 2 } ` ;
106
+ const { stdout} = await $ `echo.js 1 ${ 2 } ` ;
107
107
t . is ( stdout , '1\n2' ) ;
108
108
} ) ;
109
109
110
110
test ( '$ allows array interpolation' , async t => {
111
- const { stdout} = await $ `node test/fixtures/ echo.js ${ [ 'foo' , 'bar' ] } ` ;
111
+ const { stdout} = await $ `echo.js ${ [ 'foo' , 'bar' ] } ` ;
112
112
t . is ( stdout , 'foo\nbar' ) ;
113
113
} ) ;
114
114
115
115
test ( '$ allows execa return value interpolation' , async t => {
116
- const foo = await $ `node test/fixtures/ echo.js foo` ;
117
- const { stdout} = await $ `node test/fixtures/ echo.js ${ foo } bar` ;
116
+ const foo = await $ `echo.js foo` ;
117
+ const { stdout} = await $ `echo.js ${ foo } bar` ;
118
118
t . is ( stdout , 'foo\nbar' ) ;
119
119
} ) ;
120
120
121
121
test ( '$ allows execa return value array interpolation' , async t => {
122
- const foo = await $ `node test/fixtures/ echo.js foo` ;
123
- const { stdout} = await $ `node test/fixtures/ echo.js ${ [ foo , 'bar' ] } ` ;
122
+ const foo = await $ `echo.js foo` ;
123
+ const { stdout} = await $ `echo.js ${ [ foo , 'bar' ] } ` ;
124
124
t . is ( stdout , 'foo\nbar' ) ;
125
125
} ) ;
126
126
127
127
test ( '$ allows execa return value buffer interpolation' , async t => {
128
- const foo = await $ ( { encoding : null } ) `node test/fixtures/ echo.js foo` ;
129
- const { stdout} = await $ `node test/fixtures/ echo.js ${ foo } bar` ;
128
+ const foo = await $ ( { encoding : null } ) `echo.js foo` ;
129
+ const { stdout} = await $ `echo.js ${ foo } bar` ;
130
130
t . is ( stdout , 'foo\nbar' ) ;
131
131
} ) ;
132
132
133
133
test ( '$ allows execa return value buffer array interpolation' , async t => {
134
- const foo = await $ ( { encoding : null } ) `node test/fixtures/ echo.js foo` ;
135
- const { stdout} = await $ `node test/fixtures/ echo.js ${ [ foo , 'bar' ] } ` ;
134
+ const foo = await $ ( { encoding : null } ) `echo.js foo` ;
135
+ const { stdout} = await $ `echo.js ${ [ foo , 'bar' ] } ` ;
136
136
t . is ( stdout , 'foo\nbar' ) ;
137
137
} ) ;
138
138
139
139
test ( '$ ignores consecutive spaces' , async t => {
140
- const { stdout} = await $ `node test/fixtures/ echo.js foo bar` ;
140
+ const { stdout} = await $ `echo.js foo bar` ;
141
141
t . is ( stdout , 'foo\nbar' ) ;
142
142
} ) ;
143
143
144
144
test ( '$ allows escaping spaces with interpolation' , async t => {
145
- const { stdout} = await $ `node test/fixtures/ echo.js ${ 'foo bar' } ` ;
145
+ const { stdout} = await $ `echo.js ${ 'foo bar' } ` ;
146
146
t . is ( stdout , 'foo bar' ) ;
147
147
} ) ;
148
148
149
149
test ( '$ disallows escaping spaces with backslashes' , async t => {
150
- const { stdout} = await $ `node test/fixtures/ echo.js foo\\ bar` ;
150
+ const { stdout} = await $ `echo.js foo\\ bar` ;
151
151
t . is ( stdout , 'foo\\\nbar' ) ;
152
152
} ) ;
153
153
154
154
test ( '$ allows space escaped values in array interpolation' , async t => {
155
- const { stdout} = await $ `node test/fixtures/ echo.js ${ [ 'foo' , 'bar baz' ] } ` ;
155
+ const { stdout} = await $ `echo.js ${ [ 'foo' , 'bar baz' ] } ` ;
156
156
t . is ( stdout , 'foo\nbar baz' ) ;
157
157
} ) ;
158
158
159
159
test ( '$ passes newline escape sequence as one argument' , async t => {
160
- const { stdout} = await $ `node test/fixtures/ echo.js \n` ;
160
+ const { stdout} = await $ `echo.js \n` ;
161
161
t . is ( stdout , '\n' ) ;
162
162
} ) ;
163
163
164
164
test ( '$ passes newline escape sequence in interpolation as one argument' , async t => {
165
- const { stdout} = await $ `node test/fixtures/ echo.js ${ '\n' } ` ;
165
+ const { stdout} = await $ `echo.js ${ '\n' } ` ;
166
166
t . is ( stdout , '\n' ) ;
167
167
} ) ;
168
168
169
169
test ( '$ handles invalid escape sequence' , async t => {
170
- const { stdout} = await $ `node test/fixtures/ echo.js \u` ;
170
+ const { stdout} = await $ `echo.js \u` ;
171
171
t . is ( stdout , '\\u' ) ;
172
172
} ) ;
173
173
@@ -177,17 +177,17 @@ test('$ allows escaping spaces in commands with interpolation', async t => {
177
177
} ) ;
178
178
179
179
test ( '$ escapes other whitespaces' , async t => {
180
- const { stdout} = await $ `node test/fixtures/ echo.js foo\tbar` ;
180
+ const { stdout} = await $ `echo.js foo\tbar` ;
181
181
t . is ( stdout , 'foo\tbar' ) ;
182
182
} ) ;
183
183
184
184
test ( '$ trims' , async t => {
185
- const { stdout} = await $ ` node test/fixtures/ echo.js foo bar ` ;
185
+ const { stdout} = await $ ` echo.js foo bar ` ;
186
186
t . is ( stdout , 'foo\nbar' ) ;
187
187
} ) ;
188
188
189
189
test ( '$.sync' , t => {
190
- const { stdout} = $ . sync `node test/fixtures/ echo.js foo bar` ;
190
+ const { stdout} = $ . sync `echo.js foo bar` ;
191
191
t . is ( stdout , 'foo\nbar' ) ;
192
192
} ) ;
193
193
@@ -197,38 +197,38 @@ test('$.sync accepts options', t => {
197
197
} ) ;
198
198
199
199
test ( '$.sync allows execa return value interpolation' , t => {
200
- const foo = $ . sync `node test/fixtures/ echo.js foo` ;
201
- const { stdout} = $ . sync `node test/fixtures/ echo.js ${ foo } bar` ;
200
+ const foo = $ . sync `echo.js foo` ;
201
+ const { stdout} = $ . sync `echo.js ${ foo } bar` ;
202
202
t . is ( stdout , 'foo\nbar' ) ;
203
203
} ) ;
204
204
205
205
test ( '$.sync allows execa return value array interpolation' , t => {
206
- const foo = $ . sync `node test/fixtures/ echo.js foo` ;
207
- const { stdout} = $ . sync `node test/fixtures/ echo.js ${ [ foo , 'bar' ] } ` ;
206
+ const foo = $ . sync `echo.js foo` ;
207
+ const { stdout} = $ . sync `echo.js ${ [ foo , 'bar' ] } ` ;
208
208
t . is ( stdout , 'foo\nbar' ) ;
209
209
} ) ;
210
210
211
211
test ( '$.sync allows execa return value buffer interpolation' , t => {
212
- const foo = $ ( { encoding : null } ) . sync `node test/fixtures/ echo.js foo` ;
213
- const { stdout} = $ . sync `node test/fixtures/ echo.js ${ foo } bar` ;
212
+ const foo = $ ( { encoding : null } ) . sync `echo.js foo` ;
213
+ const { stdout} = $ . sync `echo.js ${ foo } bar` ;
214
214
t . is ( stdout , 'foo\nbar' ) ;
215
215
} ) ;
216
216
217
217
test ( '$.sync allows execa return value buffer array interpolation' , t => {
218
- const foo = $ ( { encoding : null } ) . sync `node test/fixtures/ echo.js foo` ;
219
- const { stdout} = $ . sync `node test/fixtures/ echo.js ${ [ foo , 'bar' ] } ` ;
218
+ const foo = $ ( { encoding : null } ) . sync `echo.js foo` ;
219
+ const { stdout} = $ . sync `echo.js ${ [ foo , 'bar' ] } ` ;
220
220
t . is ( stdout , 'foo\nbar' ) ;
221
221
} ) ;
222
222
223
223
const invalidExpression = test . macro ( {
224
224
async exec ( t , input , expected ) {
225
225
await t . throwsAsync (
226
- async ( ) => $ `node test/fixtures/ echo.js ${ input } ` ,
226
+ async ( ) => $ `echo.js ${ input } ` ,
227
227
{ instanceOf : TypeError , message : expected } ,
228
228
) ;
229
229
230
230
t . throws (
231
- ( ) => $ . sync `node test/fixtures/ echo.js ${ input } ` ,
231
+ ( ) => $ . sync `echo.js ${ input } ` ,
232
232
{ instanceOf : TypeError , message : expected } ,
233
233
) ;
234
234
} ,
0 commit comments