Skip to content

Commit 3ba9598

Browse files
Jake ChampionJakeChampion
authored andcommitted
add test for custom input file path
1 parent 7316625 commit 3ba9598

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 create wasm file and return zero exit code', async function (t) {
8+
const { execute, cleanup, writeFile, exists, path } = await prepareEnvironment();
9+
t.teardown(async function () {
10+
await cleanup();
11+
});
12+
13+
await writeFile('./index.js', `addEventListener('fetch', function(){})`)
14+
15+
t.is(await exists('./bin/main.wasm'), false)
16+
17+
const { code, stdout, stderr } = await execute('node', `${cli} ${path}/index.js`);
18+
19+
t.is(await exists('./bin/main.wasm'), true)
20+
t.alike(stdout, []);
21+
t.alike(stderr, []);
22+
t.is(code, 0);
23+
});

0 commit comments

Comments
 (0)