Skip to content

Commit c39b635

Browse files
Add worker test for node:wasi exports
Co-Authored-By: [email protected] <[email protected]>
1 parent 35a76b4 commit c39b635

File tree

1 file changed

+9
-0
lines changed
  • packages/wrangler/e2e/unenv-preset/worker

1 file changed

+9
-0
lines changed

packages/wrangler/e2e/unenv-preset/worker/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,4 +573,13 @@ export const WorkerdTests: Record<string, () => void> = {
573573
assert.throws(() => cluster.disconnect(), /not implemented/);
574574
assert.throws(() => cluster.fork(), /not implemented/);
575575
},
576+
577+
async testWasi() {
578+
const wasi = await import("node:wasi");
579+
580+
assert.strictEqual(typeof wasi.WASI, "function");
581+
582+
assert.throws(() => new wasi.WASI({}), /not implemented/);
583+
assert.throws(() => new wasi.WASI({ version: "preview1" }), /not implemented/);
584+
},
576585
};

0 commit comments

Comments
 (0)