Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit ccb4699

Browse files
committed
fix: correct usage of execa
1 parent 3ec96ad commit ccb4699

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: tests/cli-test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tslint:disable:no-implicit-dependencies
22
import test from 'ava';
3-
import { shell } from 'execa';
3+
import execa from 'execa';
44
import * as fs from 'fs';
55

66
function normalize(input: string): string {
@@ -12,17 +12,17 @@ function normalize(input: string): string {
1212
test('cli should read from stdin', async t => {
1313
const expected = fs.readFileSync('./tests/import-react-component.d.ts').toString();
1414

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});
1717

1818
t.is(normalize(result.stdout), normalize(expected));
1919
});
2020

2121
test('cli should read from file', async t => {
2222
const expected = fs.readFileSync('./tests/import-react-component.d.ts').toString();
2323

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});
2626

2727
t.is(normalize(result.stdout), normalize(expected));
2828
});

0 commit comments

Comments
 (0)