aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-wasm/test/node.mjs
diff options
context:
space:
mode:
authorGravatar jhmaster <32803471+jhmaster2000@users.noreply.github.com> 2023-08-11 22:20:21 -0300
committerGravatar GitHub <noreply@github.com> 2023-08-11 18:20:21 -0700
commit117cee5ca5c36f78ae75a0dee3178620bba73968 (patch)
treee295c758d3873b8ff904cd705235cd0d51648391 /packages/bun-wasm/test/node.mjs
parent43ebffedcdc47da9b9f89a07c9a5d21a7e303722 (diff)
downloadbun-117cee5ca5c36f78ae75a0dee3178620bba73968.tar.gz
bun-117cee5ca5c36f78ae75a0dee3178620bba73968.tar.zst
bun-117cee5ca5c36f78ae75a0dee3178620bba73968.zip
`bun-wasm` fixes & improvements (#4126)
* automate Bun.version & revision polyfills * polyfill Bun.gc * bun:jsc module initial polyfills * fixes & improvements to bun-wasm
Diffstat (limited to 'packages/bun-wasm/test/node.mjs')
-rw-r--r--packages/bun-wasm/test/node.mjs7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/bun-wasm/test/node.mjs b/packages/bun-wasm/test/node.mjs
index 2699a1dad..9c2f503d4 100644
--- a/packages/bun-wasm/test/node.mjs
+++ b/packages/bun-wasm/test/node.mjs
@@ -1,7 +1,10 @@
import { readFileSync } from "fs";
import { init, getTests } from "../index.mjs";
-const buf = (process.argv.length > 2 ? readFileSync(process.argv.at(-1)) : "") || readFileSync(import.meta.url);
-await init(new URL("../bun.wasm", import.meta.url));
+const filePath = process.argv[2];
+if (!filePath) throw new Error("Usage: node node.mjs <file>");
+
+const buf = readFileSync(filePath);
+await init();
console.log(getTests(buf));