Skip to content

@cloudflare/vitest-pool-workers@0.17.0

Choose a tag to compare

@workers-devprod workers-devprod released this 30 Jun 16:38
13c69dd

Minor Changes

  • #14490 75d8cb0 Thanks @petebacondarwin! - Make Workflow introspector get() async

    The introspectWorkflow(...).get() method now returns a promise, so callers must await it:

    const introspector = await introspectWorkflow(env.MY_WORKFLOW);
    
    // Before
    const instances = introspector.get();
    
    // After
    const instances = await introspector.get();

    This aligns Workflow introspection with the shared implementation used by createTestHarness().

Patch Changes

  • #14490 75d8cb0 Thanks @petebacondarwin! - Support require("./x.wasm?module") in CommonJS dependencies

    Previously, only literal await import("./x.wasm?module") specifiers were rewritten through the static analysis path added in #11094. CommonJS dependencies that use require("./x.wasm?module") reach the module-fallback service at runtime, where the ?module suffix went unhandled. The fallback either failed with No such module "<abs>/x.wasm?module" or, when a CompiledWasm rule was configured, attempted to evaluate the WebAssembly bytes as JavaScript.

    However, these require()s work in deployed workers because esbuild's bundler statically rewrites these require() calls into ES dynamic imports. vitest-pool-workers' Vite-based pipeline doesn't do that rewrite and instead defers to the module-fallback at runtime.

    The module-fallback now strips ?module from the resolved target and synthesizes a CommonJS wrapper that re-requires the underlying .wasm by absolute path, exposing it on default to match what workerd produces for CompiledWasm modules.

  • Updated dependencies [75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, f10d4ad, 75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, d292046, 75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, 75d8cb0, e0cc2cb, 75d8cb0, 75d8cb0, 75d8cb0]:

    • wrangler@4.106.0
    • miniflare@4.20260630.0