-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(create-dapp): basic init flags sanity test
- Loading branch information
1 parent
d557a6f
commit ba9da43
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); |
This file was deleted.
Oops, something went wrong.