Skip to content

Commit

Permalink
test(create-dapp): basic init flags sanity test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 14, 2023
1 parent 2c9b4e3 commit f94a0d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 18 additions & 0 deletions packages/create-dapp/test/test-sanity.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import test from 'ava';
import { spawnSync } from 'child_process';
import { fileURLToPath } from 'url';

const binname = fileURLToPath(
new URL('../src/create-dapp.js', import.meta.url),
);

test('sanity', async t => {
await null;
const myMain = args => {
return spawnSync(binname, args, { stdio: 'ignore' }).status;
};

t.is(await myMain(['--help']), 0, '--help exits zero');
t.is(await myMain(['--version']), 0, '--version exits zero');
t.is(await myMain(['--zorgar']), 1, 'unknown flag fails');
});
3 changes: 0 additions & 3 deletions packages/create-dapp/test/test-stub.js

This file was deleted.

0 comments on commit f94a0d5

Please sign in to comment.