aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-wasm/test/node.mjs
diff options
context:
space:
mode:
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));