Minor Changes
-
#5612
8f470d9
Thanks @Skye-31! - Feat: Support specifying an environment for your worker when running tests. This allows your tests to pick up bindings & variables that are scoped to specific environments.For example:
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { poolOptions: { workers: { wrangler: { configPath: "./wrangler.toml", environment: "production", }, }, }, }, });
Patch Changes
-
#5589
92bc055
Thanks @Skye-31! - fix: Support importing ES modules from libraries that do not correctly provide"type"="module"
not use.mjs
extensionsThe toucan-js library has an entry point of
"module": "dist/index.esm.js"
. This file does not use the standard.mjs
extension, nor does it specify"type"="module"
, so the resolution and loading algorithm fails to identify this file as an ES Module, defaulting to CommonJS, breaking Vitest.
Fixes #5588 -
Updated dependencies [
9a46e03
,c9f081a
,fbe1c9c
,22f5841
,c9f081a
]:- wrangler@3.51.0
- miniflare@3.20240405.2