diff options
author | 2023-08-11 22:20:21 -0300 | |
---|---|---|
committer | 2023-08-11 18:20:21 -0700 | |
commit | 117cee5ca5c36f78ae75a0dee3178620bba73968 (patch) | |
tree | e295c758d3873b8ff904cd705235cd0d51648391 /packages/bun-wasm/test/node.mjs | |
parent | 43ebffedcdc47da9b9f89a07c9a5d21a7e303722 (diff) | |
download | bun-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.mjs | 7 |
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)); |