Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Aug 8, 2023
1 parent 082c68f commit 6277fbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
Binary file added adapter.wasm
Binary file not shown.
19 changes: 9 additions & 10 deletions test/cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deepStrictEqual, ok, strictEqual } from 'node:assert';
import { readFile, rm } from 'node:fs/promises';
import { readFile, rm, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'url';
import { exec, jcoPath } from './helpers.js';
import { tmpdir } from 'node:os';
Expand All @@ -19,15 +19,14 @@ export async function cliTest (fixtures) {
}

test('Transcoding', async () => {
try {
const { stderr } = await exec(jcoPath, 'transpile', `test/fixtures/new-big-greet.wasm`, '-o', outDir);
strictEqual(stderr, '');
const source = await readFile(`${outDir}/new-big-greet.js`);
console.log(source.toString());
}
finally {
await cleanup();
}
const outDir = fileURLToPath(new URL(`./output/nbg`, import.meta.url));
const { stderr } = await exec(jcoPath, 'transpile', `test/fixtures/new-big-greet.wasm`, '-o', outDir);
strictEqual(stderr, '');
await writeFile(`${outDir}/package.json`, JSON.stringify({ type: 'module' }));
const source = await readFile(`${outDir}/new-big-greet.js`);
console.log(source.toString());
const m = await import(`${outDir}/new-big-greet.js`);
strictEqual(m.helloWorld(), 'world');
})

test('Transpile', async () => {
Expand Down

0 comments on commit 6277fbf

Please sign in to comment.