Skip to content

Commit 1df9e8c

Browse files
Jake ChampionJakeChampion
authored andcommitted
add cli test to confirm syntactically invalid js will cause a non-zero exit code
1 parent 884e357 commit 1df9e8c

File tree

4 files changed

+2860
-315
lines changed

4 files changed

+2860
-315
lines changed

integration-tests/cli/invalid.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import test from 'brittle';
2+
import { getBinPath } from 'get-bin-path'
3+
import { prepareEnvironment } from '@gmrchk/cli-testing-library';
4+
5+
const cli = await getBinPath()
6+
7+
test('should bail on syntax errors', async function (t) {
8+
const { execute, cleanup, writeFile } = await prepareEnvironment();
9+
await writeFile('./bin/index.js', '@')
10+
const { code } = await execute(
11+
'node',
12+
cli
13+
);
14+
15+
t.is(code, 1);
16+
17+
await cleanup();
18+
});

0 commit comments

Comments
 (0)