@@ -51,13 +51,13 @@ describe('Buck worker:', () => {
51
51
} ) ;
52
52
53
53
describe ( 'handshake:' , ( ) => {
54
- it ( 'responds to a correct handshake' , ( ) => {
54
+ test ( 'responds to a correct handshake' , ( ) => {
55
55
inStream . write ( handshake ( ) ) ;
56
56
57
57
return end ( ) . then ( data => expect ( data ) . toEqual ( [ handshake ( ) ] ) ) ;
58
58
} ) ;
59
59
60
- it ( 'responds to a handshake with a `protocol_version` different from "0"' , ( ) => {
60
+ test ( 'responds to a handshake with a `protocol_version` different from "0"' , ( ) => {
61
61
inStream . write ( {
62
62
id : 0 ,
63
63
type : 'handshake' ,
@@ -76,7 +76,7 @@ describe('Buck worker:', () => {
76
76
) ;
77
77
} ) ;
78
78
79
- it ( 'errors for a second handshake' , ( ) => {
79
+ test ( 'errors for a second handshake' , ( ) => {
80
80
inStream . write ( handshake ( ) ) ;
81
81
inStream . write ( handshake ( 1 ) ) ;
82
82
@@ -90,7 +90,7 @@ describe('Buck worker:', () => {
90
90
} ) ;
91
91
} ) ;
92
92
93
- it ( 'errors for unknown message types' , ( ) => {
93
+ test ( 'errors for unknown message types' , ( ) => {
94
94
inStream . write ( handshake ( ) ) ;
95
95
inStream . write ( { id : 1 , type : 'arbitrary' } ) ;
96
96
return end ( ) . then ( ( [ , response ] ) =>
@@ -165,7 +165,7 @@ describe('Buck worker:', () => {
165
165
return Promise . all ( streamClosedPromises ) ;
166
166
} ) ;
167
167
168
- it ( 'errors if `args_path` cannot be opened' , ( ) => {
168
+ test ( 'errors if `args_path` cannot be opened' , ( ) => {
169
169
mockFiles ( { some : { 'args-path' : undefined } } ) ;
170
170
inStream . write ( command ( { id : 5 , args_path : '/some/args-path' } ) ) ;
171
171
return end ( 2 ) . then ( ( [ , response ] ) => {
@@ -177,7 +177,7 @@ describe('Buck worker:', () => {
177
177
} ) ;
178
178
} ) ;
179
179
180
- it ( 'errors if `stdout_path` cannot be opened' , ( ) => {
180
+ test ( 'errors if `stdout_path` cannot be opened' , ( ) => {
181
181
const path = '/does/not/exist' ;
182
182
inStream . write ( command ( { id : 5 , stdout_path : path } ) ) ;
183
183
return end ( 2 ) . then ( ( [ , response ] ) => {
@@ -189,7 +189,7 @@ describe('Buck worker:', () => {
189
189
} ) ;
190
190
} ) ;
191
191
192
- it ( 'errors if `stderr_path` cannot be opened' , ( ) => {
192
+ test ( 'errors if `stderr_path` cannot be opened' , ( ) => {
193
193
const path = '/does/not/exist' ;
194
194
inStream . write ( command ( { id : 5 , stderr_path : path } ) ) ;
195
195
return end ( 2 ) . then ( ( [ , response ] ) => {
@@ -201,7 +201,7 @@ describe('Buck worker:', () => {
201
201
} ) ;
202
202
} ) ;
203
203
204
- it ( 'errors for unspecified commands' , ( ) => {
204
+ test ( 'errors for unspecified commands' , ( ) => {
205
205
mockFiles ( {
206
206
arbitrary : {
207
207
file : '--flag-without-preceding-command' ,
@@ -223,7 +223,7 @@ describe('Buck worker:', () => {
223
223
) ;
224
224
} ) ;
225
225
226
- it ( 'errors for empty commands' , ( ) => {
226
+ test ( 'errors for empty commands' , ( ) => {
227
227
mockFiles ( {
228
228
arbitrary : {
229
229
file : '' ,
@@ -245,7 +245,7 @@ describe('Buck worker:', () => {
245
245
) ;
246
246
} ) ;
247
247
248
- it ( 'errors for unknown commands' , ( ) => {
248
+ test ( 'errors for unknown commands' , ( ) => {
249
249
mockFiles ( {
250
250
arbitrary : {
251
251
file : 'arbitrary' ,
@@ -267,7 +267,7 @@ describe('Buck worker:', () => {
267
267
) ;
268
268
} ) ;
269
269
270
- it ( 'errors if no `args_path` is specified' , ( ) => {
270
+ test ( 'errors if no `args_path` is specified' , ( ) => {
271
271
inStream . write ( {
272
272
id : 1 ,
273
273
type : 'command' ,
@@ -283,7 +283,7 @@ describe('Buck worker:', () => {
283
283
) ;
284
284
} ) ;
285
285
286
- it ( 'errors if no `stdout_path` is specified' , ( ) => {
286
+ test ( 'errors if no `stdout_path` is specified' , ( ) => {
287
287
inStream . write ( {
288
288
id : 1 ,
289
289
type : 'command' ,
@@ -299,7 +299,7 @@ describe('Buck worker:', () => {
299
299
) ;
300
300
} ) ;
301
301
302
- it ( 'errors if no `stderr_path` is specified' , ( ) => {
302
+ test ( 'errors if no `stderr_path` is specified' , ( ) => {
303
303
inStream . write ( {
304
304
id : 1 ,
305
305
type : 'command' ,
@@ -315,7 +315,7 @@ describe('Buck worker:', () => {
315
315
) ;
316
316
} ) ;
317
317
318
- it ( 'passes arguments to an existing command' , async ( ) => {
318
+ test ( 'passes arguments to an existing command' , async ( ) => {
319
319
commands . transform = jest . fn ( ) ;
320
320
const args = 'foo bar baz\tmore' ;
321
321
mockFiles ( {
@@ -338,7 +338,7 @@ describe('Buck worker:', () => {
338
338
) ;
339
339
} ) ;
340
340
341
- it ( 'passes JSON/structured arguments to an existing command' , async ( ) => {
341
+ test ( 'passes JSON/structured arguments to an existing command' , async ( ) => {
342
342
commands . transform = jest . fn ( ) ;
343
343
const args = { foo : 'bar' , baz : 'glo' } ;
344
344
mockFiles ( {
@@ -357,7 +357,7 @@ describe('Buck worker:', () => {
357
357
expect ( commands . transform ) . toBeCalledWith ( [ ] , args , anything ( ) ) ;
358
358
} ) ;
359
359
360
- it ( 'passes a console object to the command' , ( ) => {
360
+ test ( 'passes a console object to the command' , ( ) => {
361
361
mockFiles ( {
362
362
args : 'transform' ,
363
363
stdio : { } ,
@@ -385,7 +385,7 @@ describe('Buck worker:', () => {
385
385
} ) ;
386
386
} ) ;
387
387
388
- it ( 'responds with success if the command finishes succesfully' , ( ) => {
388
+ test ( 'responds with success if the command finishes succesfully' , ( ) => {
389
389
commands . transform = ( args , _ ) => { } ;
390
390
mockFiles ( { path : { to : { args : 'transform' } } } ) ;
391
391
inStream . write (
@@ -404,7 +404,7 @@ describe('Buck worker:', () => {
404
404
) ;
405
405
} ) ;
406
406
407
- it ( 'responds with error if the command does not exist' , async ( ) => {
407
+ test ( 'responds with error if the command does not exist' , async ( ) => {
408
408
commands . transform = jest . fn ( ( ) => Promise . resolve ( ) ) ;
409
409
mockFiles ( { path : { to : { args : 'inexistent_command' } } } ) ;
410
410
inStream . write (
@@ -425,7 +425,7 @@ describe('Buck worker:', () => {
425
425
) ;
426
426
} ) ;
427
427
428
- it ( 'responds with error if the command errors asynchronously' , ( ) => {
428
+ test ( 'responds with error if the command errors asynchronously' , ( ) => {
429
429
commands . transform = jest . fn ( ( args , _ , callback ) =>
430
430
Promise . reject ( new Error ( 'arbitrary' ) ) ,
431
431
) ;
@@ -446,7 +446,7 @@ describe('Buck worker:', () => {
446
446
) ;
447
447
} ) ;
448
448
449
- it ( 'responds with error if the command throws synchronously' , ( ) => {
449
+ test ( 'responds with error if the command throws synchronously' , ( ) => {
450
450
commands . transform = ( args , _ ) => {
451
451
throw new Error ( 'arbitrary' ) ;
452
452
} ;
0 commit comments