From 8203ff6834d5f841b893a6ce8e91d61f7d737f0f Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Wed, 17 May 2023 19:56:04 -0700 Subject: [PATCH] stuff --- adapter.wasm | Bin 0 -> 570 bytes test/cli.js | 19 +++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 adapter.wasm diff --git a/adapter.wasm b/adapter.wasm new file mode 100644 index 0000000000000000000000000000000000000000..0177c1742a0e1705ca1188c24a8f886c0a0017e6 GIT binary patch literal 570 zcmaJ-!AiqG5S`iGWMiX{t9Y4hd#Hy(>p{GzO~JEwFE*s92yN4DQczIi$-fB*{)Qjr zBv=~+orQhF`BUh|Jdz|{G>ukyVh4c!D$Vj+o8%k2+|gn$x6v|-(`jGH7~=X$jll0fD1N%< zbr+a;VIUwh(kPPQE7!wyB_`Q+j2i+!BsTz~#Yl`Uu^b0)q)L+I)6D_;;MX+Nv@Xfr z(!}dX2Z}T~?1Q!ofiMoIVM`<@l { - 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 () => {