1
+ /**
2
+ * @typedef {import('execa').ExecaReturnValue } ExecaReturnValue
3
+ */
4
+
1
5
import fs from 'node:fs'
2
6
import path from 'node:path'
3
7
import process from 'node:process'
4
- import execa from 'execa'
8
+ import { execa } from 'execa'
5
9
import { bail } from 'bail'
6
10
import test from 'tape'
7
11
import strip from 'strip-ansi'
@@ -28,7 +32,7 @@ test('unified-args', (t) => {
28
32
29
33
execa ( bin , [ 'missing.txt' ] ) . then (
30
34
( ) => t . fail ( ) ,
31
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
35
+ ( /** @type {ExecaReturnValue } */ error ) => {
32
36
t . deepEqual (
33
37
[ error . exitCode , strip ( error . stderr ) ] ,
34
38
[ 1 , expected ] ,
@@ -125,7 +129,7 @@ test('unified-args', (t) => {
125
129
126
130
execa ( bin , [ '-n' ] ) . then (
127
131
( ) => t . fail ( ) ,
128
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
132
+ ( /** @type {ExecaReturnValue } */ error ) => {
129
133
t . deepEqual (
130
134
[ error . exitCode , strip ( error . stderr ) ] ,
131
135
[ 1 , expected ] ,
@@ -145,7 +149,7 @@ test('unified-args', (t) => {
145
149
146
150
execa ( bin , [ '-on' ] ) . then (
147
151
( ) => t . fail ( ) ,
148
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
152
+ ( /** @type {ExecaReturnValue } */ error ) => {
149
153
t . deepEqual (
150
154
[ error . exitCode , strip ( error . stderr ) ] ,
151
155
[ 1 , expected ] ,
@@ -165,7 +169,7 @@ test('unified-args', (t) => {
165
169
166
170
execa ( bin , [ '--no' ] ) . then (
167
171
( ) => t . fail ( ) ,
168
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
172
+ ( /** @type {ExecaReturnValue } */ error ) => {
169
173
t . deepEqual (
170
174
[ error . exitCode , strip ( error . stderr ) ] ,
171
175
[ 1 , expected ] ,
@@ -290,7 +294,7 @@ test('unified-args', (t) => {
290
294
291
295
execa ( bin , [ '.' , flag ] ) . then (
292
296
( ) => t . fail ( ) ,
293
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
297
+ ( /** @type {ExecaReturnValue } */ error ) => {
294
298
t . deepEqual (
295
299
[ error . stdout , error . stderr ] ,
296
300
[ '' , expected ] ,
@@ -337,7 +341,7 @@ test('unified-args', (t) => {
337
341
// Should be quoted.
338
342
execa ( bin , [ '.' , flag , 'foo:bar' ] ) . then (
339
343
( ) => t . fail ( ) ,
340
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
344
+ ( /** @type {ExecaReturnValue } */ error ) => {
341
345
t . deepEqual (
342
346
[ error . exitCode , strip ( error . stderr ) ] ,
343
347
[ 1 , expected ] ,
@@ -416,7 +420,7 @@ test('unified-args', (t) => {
416
420
// Should be quoted.
417
421
execa ( bin , [ '.' , flag , './plugin.js=foo:bar' ] ) . then (
418
422
( ) => t . fail ( ) ,
419
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
423
+ ( /** @type {ExecaReturnValue } */ error ) => {
420
424
t . deepEqual (
421
425
[ error . exitCode , strip ( error . stderr ) ] ,
422
426
[ 1 , expected ] ,
@@ -495,7 +499,7 @@ test('unified-args', (t) => {
495
499
496
500
execa ( bin , [ '.' , '--report' ] ) . then (
497
501
( ) => t . fail ( ) ,
498
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
502
+ ( /** @type {ExecaReturnValue } */ error ) => {
499
503
t . deepEqual (
500
504
[ error . exitCode , error . stderr ] ,
501
505
[ 1 , 'Error: Missing value: --report <reporter> specify reporter' ] ,
@@ -604,7 +608,7 @@ test('unified-args', (t) => {
604
608
605
609
execa ( bin , [ 'one.txt' , 'two.txt' , '--ignore-pattern' , 'one.txt' ] ) . then (
606
610
( ) => t . fail ( ) ,
607
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
611
+ ( /** @type {ExecaReturnValue } */ error ) => {
608
612
t . deepEqual (
609
613
[ error . exitCode , strip ( error . stderr ) ] ,
610
614
[ 1 , expected ] ,
@@ -659,7 +663,7 @@ test('unified-args', (t) => {
659
663
660
664
setTimeout ( seeYouLaterAlligator , delay )
661
665
662
- function onsuccess ( /** @type {execa. ExecaReturnValue } */ result ) {
666
+ function onsuccess ( /** @type {ExecaReturnValue } */ result ) {
663
667
resolved = true
664
668
fs . unlinkSync ( doc )
665
669
t . deepEqual (
@@ -714,7 +718,7 @@ test('unified-args', (t) => {
714
718
715
719
setTimeout ( seeYouLaterAlligator , delay )
716
720
717
- function onsuccess ( /** @type {execa. ExecaReturnValue } */ result ) {
721
+ function onsuccess ( /** @type {ExecaReturnValue } */ result ) {
718
722
resolved = true
719
723
720
724
fs . unlinkSync ( doc )
@@ -748,7 +752,7 @@ test('unified-args', (t) => {
748
752
749
753
execa ( bin , [ '-w' ] ) . then (
750
754
( ) => t . fail ( ) ,
751
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
755
+ ( /** @type {ExecaReturnValue } */ error ) => {
752
756
const actual = strip ( error . stderr ) . split ( '\n' ) . slice ( 0 , 2 ) . join ( '\n' )
753
757
754
758
t . deepEqual ( [ error . exitCode , actual ] , [ 1 , expected ] , 'should fail' )
@@ -764,7 +768,7 @@ test('unified-args', (t) => {
764
768
765
769
execa ( bin , [ '.' , '-u' , './plugin.js' ] ) . then (
766
770
( ) => t . fail ( ) ,
767
- ( /** @type {execa. ExecaReturnValue } */ error ) => {
771
+ ( /** @type {ExecaReturnValue } */ error ) => {
768
772
t . deepEqual (
769
773
[ error . exitCode , strip ( error . stderr ) ] ,
770
774
[ 1 , expected ] ,
0 commit comments