From d1eba784b9d902ac6043c1b76e64382d43fbc261 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Thu, 24 Feb 2022 19:09:55 -0800 Subject: Add WASM modules but disable it for now --- integration/bunjs-only-snippets/exit.js | 2 ++ .../bunjs-only-snippets/wasm-return-1-test.zig | 5 +++++ integration/bunjs-only-snippets/wasm.js | 1 + integration/bunjs-only-snippets/wasm.test.js | 20 ++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 integration/bunjs-only-snippets/exit.js create mode 100644 integration/bunjs-only-snippets/wasm-return-1-test.zig create mode 100644 integration/bunjs-only-snippets/wasm.js create mode 100644 integration/bunjs-only-snippets/wasm.test.js (limited to 'integration/bunjs-only-snippets') diff --git a/integration/bunjs-only-snippets/exit.js b/integration/bunjs-only-snippets/exit.js new file mode 100644 index 000000000..fb28b1fb4 --- /dev/null +++ b/integration/bunjs-only-snippets/exit.js @@ -0,0 +1,2 @@ +process.exit(0); +throw new Error("Well that didn't work"); diff --git a/integration/bunjs-only-snippets/wasm-return-1-test.zig b/integration/bunjs-only-snippets/wasm-return-1-test.zig new file mode 100644 index 000000000..d46bdae92 --- /dev/null +++ b/integration/bunjs-only-snippets/wasm-return-1-test.zig @@ -0,0 +1,5 @@ +export fn hello() i32 { + return 1; +} + +pub fn main() void {} diff --git a/integration/bunjs-only-snippets/wasm.js b/integration/bunjs-only-snippets/wasm.js new file mode 100644 index 000000000..a4daaaffe --- /dev/null +++ b/integration/bunjs-only-snippets/wasm.js @@ -0,0 +1 @@ +import * as wasm from "./wasm-return-1-test.wasm"; diff --git a/integration/bunjs-only-snippets/wasm.test.js b/integration/bunjs-only-snippets/wasm.test.js new file mode 100644 index 000000000..ab88d5beb --- /dev/null +++ b/integration/bunjs-only-snippets/wasm.test.js @@ -0,0 +1,20 @@ +import { it } from "bun:test"; +// import * as wasm from "./wasm-return-1-test.wasm"; + +// import { readFileSync } from "fs"; + +// it("wasm readFileSync", async () => { +// console.log("here"); +// console.log(wasm.hello()); +// }); + +// it("wasm import", async () => { +// console.log("heyt"); +// try { +// console.log("hi"); +// expect(wasm.hello()).toBe(1); +// } catch (err) { +// console.error(err); +// throw err; +// } +// }); -- cgit v1.2.3