File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ export class ProcessPromise extends Promise<ProcessOutput> {
232
232
let reject : Resolve
233
233
super ( ( ...args ) => {
234
234
; [ resolve , reject ] = args
235
- executor ?. ( ...args )
235
+ executor ( ...args )
236
236
} )
237
237
238
238
if ( bound . length ) {
Original file line number Diff line number Diff line change @@ -575,6 +575,15 @@ describe('core', () => {
575
575
assert . equal ( p . stdout . trim ( ) , 'foo' )
576
576
} )
577
577
578
+ test ( 'detects inappropriate ProcessPromise' , async ( ) => {
579
+ const foo = $ `echo foo`
580
+ const p1 = $ `cat`
581
+ const p2 = p1 . then ( ( v ) => v )
582
+
583
+ assert . throws ( ( ) => foo . pipe ( p2 ) , / I n a p p r o p r i a t e u s a g e / )
584
+ await foo . pipe ( p1 )
585
+ } )
586
+
578
587
test ( 'accepts $ template literal' , async ( ) => {
579
588
const p = await $ `echo foo` . pipe `cat`
580
589
assert . equal ( p . stdout . trim ( ) , 'foo' )
You can’t perform that action at this time.
0 commit comments