Skip to content

Commit 89cac01

Browse files
test(jco): remove todo on throwing for overflow
1 parent 748fc9b commit 89cac01

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

packages/jco/test/p3/async.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { join } from "node:path";
22

3-
import { suite, test, assert } from "vitest";
3+
import { suite, test, assert, expect } from "vitest";
44

55
import { WASIShim } from "@bytecodealliance/preview2-shim/instantiation";
66

@@ -31,10 +31,7 @@ suite("Async (WASI P3)", () => {
3131
const result = await instance.asyncAddS32.add(2, 2);
3232
assert.strictEqual(result, 4);
3333

34-
// TODO(fix): this line should throw the value, not return a result object,
35-
// this behavior does not match the default for non-erroring call
36-
const res = await instance.asyncAddS32.add(1, 2147483647);
37-
assert.deepStrictEqual(res, { tag: "error", val: "overflow" });
34+
await expect(() => instance.asyncAddS32.add(1, 2147483647)).rejects.toThrowError(/overflow/);
3835

3936
await cleanup();
4037
});

packages/jco/test/p3/stream.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ suite("stream<T> lifts", () => {
1818
path: join(LOCAL_TEST_COMPONENTS_DIR, `${name}.wasm`),
1919
skipInstantiation: true,
2020
},
21-
jco: {
22-
transpile: {
23-
extraArgs: {
24-
minify: false,
25-
},
26-
},
27-
},
21+
// jco: {
22+
// transpile: {
23+
// extraArgs: {
24+
// minify: false,
25+
// },
26+
// },
27+
// },
2828
});
2929

3030
esModule = setupRes.esModule;

0 commit comments

Comments
 (0)