File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,10 @@ export class ProcessOutput extends Error {
448
448
return this . _combined
449
449
}
450
450
451
+ valueOf ( ) {
452
+ return this . _combined . trim ( )
453
+ }
454
+
451
455
get stdout ( ) {
452
456
return this . _stdout
453
457
}
Original file line number Diff line number Diff line change @@ -188,6 +188,17 @@ describe('core', () => {
188
188
assert . ok ( p5 !== p1 )
189
189
} )
190
190
191
+ test ( 'ProcessPromise: implements toString()' , async ( ) => {
192
+ const p = $ `echo foo`
193
+ assert . equal ( ( await p ) . toString ( ) , 'foo\n' )
194
+ } )
195
+
196
+ test ( 'ProcessPromise: implements valueOf()' , async ( ) => {
197
+ const p = $ `echo foo`
198
+ assert . equal ( ( await p ) . valueOf ( ) , 'foo' )
199
+ assert . ok ( ( await p ) == 'foo' )
200
+ } )
201
+
191
202
test ( 'cd() works with relative paths' , async ( ) => {
192
203
let cwd = process . cwd ( )
193
204
try {
You can’t perform that action at this time.
0 commit comments