pi-mono/packages/durable/test/codemode-imports.test.ts
Mario Zechner bb65e3e497 fix(durable): import toCodemodeIdentifier from pi-codemode/declarations
The Code Mode extension imported it from /portable, which loads the WASM
QuickJS runtime the extension never uses.

closes #11254
2026-10-27 21:31:47 +00:00

11 lines
471 B
TypeScript

import { expect, test, vi } from "vitest";
import { createCodemodeExtension } from "../src/codemode/codemode.ts";
// The extension runs scripts in the sandbox the host passes, so loading it must not load the WASM VM (#11254).
vi.mock("quickjs-wasi", () => {
throw new Error("the Code Mode extension loaded quickjs-wasi");
});
test("the Code Mode extension loads without pi-codemode's WASM runtime", () => {
expect(createCodemodeExtension).toBeTypeOf("function");
});