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 0213496
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
run: cd packages/cache && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (casting)
run: cd packages/casting && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (create-dapp)
run: cd packages/create-dapp && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (internal)
run: cd packages/internal && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
- name: yarn test (pegasus)
Expand Down
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 0213496

Please sign in to comment.