This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
// tslint:disable:no-implicit-dependencies
2
2
import test from 'ava' ;
3
- import { shell } from 'execa' ;
3
+ import execa from 'execa' ;
4
4
import * as fs from 'fs' ;
5
5
6
6
function normalize ( input : string ) : string {
@@ -12,17 +12,17 @@ function normalize(input: string): string {
12
12
test ( 'cli should read from stdin' , async t => {
13
13
const expected = fs . readFileSync ( './tests/import-react-component.d.ts' ) . toString ( ) ;
14
14
15
- const result = await shell (
16
- `cat ./tests/import-react-component.jsx |${ process . argv [ 0 ] } ./cli.js --module-name component` ) ;
15
+ const result = await execa (
16
+ `cat ./tests/import-react-component.jsx |${ process . argv [ 0 ] } ./cli.js --module-name component` , { shell : true } ) ;
17
17
18
18
t . is ( normalize ( result . stdout ) , normalize ( expected ) ) ;
19
19
} ) ;
20
20
21
21
test ( 'cli should read from file' , async t => {
22
22
const expected = fs . readFileSync ( './tests/import-react-component.d.ts' ) . toString ( ) ;
23
23
24
- const result = await shell (
25
- `${ process . argv [ 0 ] } ./cli.js --module-name component --file ./tests/import-react-component.jsx` ) ;
24
+ const result = await execa (
25
+ `${ process . argv [ 0 ] } ./cli.js --module-name component --file ./tests/import-react-component.jsx` , { shell : true } ) ;
26
26
27
27
t . is ( normalize ( result . stdout ) , normalize ( expected ) ) ;
28
28
} ) ;
You can’t perform that action at this time.
0 commit comments