From 68fac09dbd600dcdf184de4f8e39169d6188b6e0 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 18 Jun 2024 12:32:03 +0100 Subject: [PATCH] chore: change vitest config to be ESM (for sure) to avoid warnings (#6055) Without this we often see: ``` The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details. ``` --- CONTRIBUTING.md | 2 +- .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 fixtures/local-mode-tests/tsconfig.json | 2 +- .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../test/fetch-integration-self.test.ts | 2 +- .../test/scheduled-integration-self.test.ts | 2 +- .../vitest-pool-workers-examples/d1/README.md | 2 +- .../d1/test/env.d.ts | 2 +- .../hyperdrive/README.md | 2 +- .../hyperdrive/wrangler.toml | 2 +- .../misc/test/defines.test.ts | 2 +- .../multiple-workers/test/env.d.ts | 2 +- .../test/integration-self.test.ts | 2 +- .../queue-consumer-integration-self.test.ts | 2 +- .../queues/test/queue-producer-unit.test.ts | 2 +- .../queues/wrangler.toml | 2 +- .../vitest.workspace.ts | 2 +- .../{vitest.config.ts => vitest.config.mts} | 0 lint-turbo.mjs | 5 +++- .../{vitest.config.ts => vitest.config.mts} | 0 packages/create-cloudflare/package.json | 6 ++--- .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 packages/vitest-pool-workers/.eslintrc.js | 2 +- .../src/worker/fetch-mock.ts | 2 +- .../vitest-pool-workers/test/chunking.test.ts | 2 +- .../vitest-pool-workers/test/console.test.ts | 4 +-- .../test/isolation.test.ts | 8 +++--- .../test/snapshots.test.ts | 6 ++--- .../test/validation.test.ts | 26 +++++++++---------- .../vitest-pool-workers/test/watch.test.ts | 4 +-- packages/vitest-pool-workers/tsconfig.json | 2 +- .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 .../{vitest.config.ts => vitest.config.mts} | 0 packages/wrangler/package.json | 2 +- .../{vitest.config.ts => vitest.config.mts} | 0 tools/{vitest.config.ts => vitest.config.mts} | 0 vitest.workspace.ts | 6 ++--- 74 files changed, 54 insertions(+), 51 deletions(-) rename fixtures/additional-modules/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/ai-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/dev-env/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/durable-objects-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/entrypoints-rpc-tests/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/external-durable-objects-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/external-service-bindings-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/get-bindings-proxy/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/get-platform-proxy/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/import-wasm-example/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/interactive-dev-tests/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/local-mode-tests/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/no-bundle-import/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/node-app-pages/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/nodejs-hybrid-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-d1-shim/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-dev-proxy-with-script/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-functions-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-functions-wasm-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-functions-with-config-file-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-functions-with-routes-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-plugin-mounted-on-root-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-proxy-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-simple-assets/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-and-functions-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-directory/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-wasm-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-with-config-file-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-workerjs-with-routes-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/pages-ws-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/ratelimit-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/remix-pages-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/service-bindings-app/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/type-generation/{vitest.config.ts => vitest.config.mts} (100%) rename fixtures/worker-app/{vitest.config.ts => vitest.config.mts} (100%) rename packages/cli/{vitest.config.ts => vitest.config.mts} (100%) rename packages/create-cloudflare/templates/hello-world/ts/{vitest.config.ts => vitest.config.mts} (100%) rename packages/create-cloudflare/{vitest.config.ts => vitest.config.mts} (100%) rename packages/edge-preview-authenticated-proxy/{vitest.config.ts => vitest.config.mts} (100%) rename packages/pages-shared/{vitest.config.ts => vitest.config.mts} (100%) rename packages/vitest-pool-workers/{vitest.config.ts => vitest.config.mts} (100%) rename packages/workers.new/{vitest.config.ts => vitest.config.mts} (100%) rename packages/wrangler/e2e/{vitest.config.ts => vitest.config.mts} (100%) rename packages/wrangler/{vitest.config.ts => vitest.config.mts} (100%) rename tools/{vitest.config.ts => vitest.config.mts} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c07d3c5ead2a..6c573398dbea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -211,7 +211,7 @@ As a reviewer, it's important to be thoughtful about the proposed changes and co Every PR should include tests for the functionality that's being added. Most changes will be to [Wrangler](packages/wrangler/src/__tests__) (using Vitest), [Miniflare](packages/miniflare/test) (using Ava), or [C3](packages/create-cloudflare/src/__tests__) (using Vitest), and should include unit tests within the testing harness of those packages. -If your PR includes functionality that's difficult to unit test, you can add a fixture test by creating a new package in the `fixtures/` folder. This allows for adding a test that requires a specific filesystem or worker setup (for instance, `fixtures/no-bundle-import` tests the interaction of Wrangler with a specific set of JS, WASM, text, and binary modules on the filesystem). When adding a fixture test, include a `vitest.config.ts` file within the new package, which will ensure it's run as part of the `workers-sdk` CI. You should merge your own configuration with the default config from the root of the repo. +If your PR includes functionality that's difficult to unit test, you can add a fixture test by creating a new package in the `fixtures/` folder. This allows for adding a test that requires a specific filesystem or worker setup (for instance, `fixtures/no-bundle-import` tests the interaction of Wrangler with a specific set of JS, WASM, text, and binary modules on the filesystem). When adding a fixture test, include a `vitest.config.mts` file within the new package, which will ensure it's run as part of the `workers-sdk` CI. You should merge your own configuration with the default config from the root of the repo. A good default example is the following: diff --git a/fixtures/additional-modules/vitest.config.ts b/fixtures/additional-modules/vitest.config.mts similarity index 100% rename from fixtures/additional-modules/vitest.config.ts rename to fixtures/additional-modules/vitest.config.mts diff --git a/fixtures/ai-app/vitest.config.ts b/fixtures/ai-app/vitest.config.mts similarity index 100% rename from fixtures/ai-app/vitest.config.ts rename to fixtures/ai-app/vitest.config.mts diff --git a/fixtures/dev-env/vitest.config.ts b/fixtures/dev-env/vitest.config.mts similarity index 100% rename from fixtures/dev-env/vitest.config.ts rename to fixtures/dev-env/vitest.config.mts diff --git a/fixtures/durable-objects-app/vitest.config.ts b/fixtures/durable-objects-app/vitest.config.mts similarity index 100% rename from fixtures/durable-objects-app/vitest.config.ts rename to fixtures/durable-objects-app/vitest.config.mts diff --git a/fixtures/entrypoints-rpc-tests/vitest.config.ts b/fixtures/entrypoints-rpc-tests/vitest.config.mts similarity index 100% rename from fixtures/entrypoints-rpc-tests/vitest.config.ts rename to fixtures/entrypoints-rpc-tests/vitest.config.mts diff --git a/fixtures/external-durable-objects-app/vitest.config.ts b/fixtures/external-durable-objects-app/vitest.config.mts similarity index 100% rename from fixtures/external-durable-objects-app/vitest.config.ts rename to fixtures/external-durable-objects-app/vitest.config.mts diff --git a/fixtures/external-service-bindings-app/vitest.config.ts b/fixtures/external-service-bindings-app/vitest.config.mts similarity index 100% rename from fixtures/external-service-bindings-app/vitest.config.ts rename to fixtures/external-service-bindings-app/vitest.config.mts diff --git a/fixtures/get-bindings-proxy/vitest.config.ts b/fixtures/get-bindings-proxy/vitest.config.mts similarity index 100% rename from fixtures/get-bindings-proxy/vitest.config.ts rename to fixtures/get-bindings-proxy/vitest.config.mts diff --git a/fixtures/get-platform-proxy/vitest.config.ts b/fixtures/get-platform-proxy/vitest.config.mts similarity index 100% rename from fixtures/get-platform-proxy/vitest.config.ts rename to fixtures/get-platform-proxy/vitest.config.mts diff --git a/fixtures/import-wasm-example/vitest.config.ts b/fixtures/import-wasm-example/vitest.config.mts similarity index 100% rename from fixtures/import-wasm-example/vitest.config.ts rename to fixtures/import-wasm-example/vitest.config.mts diff --git a/fixtures/interactive-dev-tests/vitest.config.ts b/fixtures/interactive-dev-tests/vitest.config.mts similarity index 100% rename from fixtures/interactive-dev-tests/vitest.config.ts rename to fixtures/interactive-dev-tests/vitest.config.mts diff --git a/fixtures/local-mode-tests/tsconfig.json b/fixtures/local-mode-tests/tsconfig.json index 448c16f49bc9..e69cb8db6a92 100644 --- a/fixtures/local-mode-tests/tsconfig.json +++ b/fixtures/local-mode-tests/tsconfig.json @@ -9,7 +9,7 @@ "target": "esnext", "strict": true, "noEmit": true, - "types": ["@cloudflare/workers-types"], + "types": ["@cloudflare/workers-types", "node"], "lib": ["esnext"], "skipLibCheck": true }, diff --git a/fixtures/local-mode-tests/vitest.config.ts b/fixtures/local-mode-tests/vitest.config.mts similarity index 100% rename from fixtures/local-mode-tests/vitest.config.ts rename to fixtures/local-mode-tests/vitest.config.mts diff --git a/fixtures/no-bundle-import/vitest.config.ts b/fixtures/no-bundle-import/vitest.config.mts similarity index 100% rename from fixtures/no-bundle-import/vitest.config.ts rename to fixtures/no-bundle-import/vitest.config.mts diff --git a/fixtures/node-app-pages/vitest.config.ts b/fixtures/node-app-pages/vitest.config.mts similarity index 100% rename from fixtures/node-app-pages/vitest.config.ts rename to fixtures/node-app-pages/vitest.config.mts diff --git a/fixtures/nodejs-hybrid-app/vitest.config.ts b/fixtures/nodejs-hybrid-app/vitest.config.mts similarity index 100% rename from fixtures/nodejs-hybrid-app/vitest.config.ts rename to fixtures/nodejs-hybrid-app/vitest.config.mts diff --git a/fixtures/pages-d1-shim/vitest.config.ts b/fixtures/pages-d1-shim/vitest.config.mts similarity index 100% rename from fixtures/pages-d1-shim/vitest.config.ts rename to fixtures/pages-d1-shim/vitest.config.mts diff --git a/fixtures/pages-dev-proxy-with-script/vitest.config.ts b/fixtures/pages-dev-proxy-with-script/vitest.config.mts similarity index 100% rename from fixtures/pages-dev-proxy-with-script/vitest.config.ts rename to fixtures/pages-dev-proxy-with-script/vitest.config.mts diff --git a/fixtures/pages-functions-app/vitest.config.ts b/fixtures/pages-functions-app/vitest.config.mts similarity index 100% rename from fixtures/pages-functions-app/vitest.config.ts rename to fixtures/pages-functions-app/vitest.config.mts diff --git a/fixtures/pages-functions-wasm-app/vitest.config.ts b/fixtures/pages-functions-wasm-app/vitest.config.mts similarity index 100% rename from fixtures/pages-functions-wasm-app/vitest.config.ts rename to fixtures/pages-functions-wasm-app/vitest.config.mts diff --git a/fixtures/pages-functions-with-config-file-app/vitest.config.ts b/fixtures/pages-functions-with-config-file-app/vitest.config.mts similarity index 100% rename from fixtures/pages-functions-with-config-file-app/vitest.config.ts rename to fixtures/pages-functions-with-config-file-app/vitest.config.mts diff --git a/fixtures/pages-functions-with-routes-app/vitest.config.ts b/fixtures/pages-functions-with-routes-app/vitest.config.mts similarity index 100% rename from fixtures/pages-functions-with-routes-app/vitest.config.ts rename to fixtures/pages-functions-with-routes-app/vitest.config.mts diff --git a/fixtures/pages-plugin-mounted-on-root-app/vitest.config.ts b/fixtures/pages-plugin-mounted-on-root-app/vitest.config.mts similarity index 100% rename from fixtures/pages-plugin-mounted-on-root-app/vitest.config.ts rename to fixtures/pages-plugin-mounted-on-root-app/vitest.config.mts diff --git a/fixtures/pages-proxy-app/vitest.config.ts b/fixtures/pages-proxy-app/vitest.config.mts similarity index 100% rename from fixtures/pages-proxy-app/vitest.config.ts rename to fixtures/pages-proxy-app/vitest.config.mts diff --git a/fixtures/pages-simple-assets/vitest.config.ts b/fixtures/pages-simple-assets/vitest.config.mts similarity index 100% rename from fixtures/pages-simple-assets/vitest.config.ts rename to fixtures/pages-simple-assets/vitest.config.mts diff --git a/fixtures/pages-workerjs-and-functions-app/vitest.config.ts b/fixtures/pages-workerjs-and-functions-app/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-and-functions-app/vitest.config.ts rename to fixtures/pages-workerjs-and-functions-app/vitest.config.mts diff --git a/fixtures/pages-workerjs-app/vitest.config.ts b/fixtures/pages-workerjs-app/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-app/vitest.config.ts rename to fixtures/pages-workerjs-app/vitest.config.mts diff --git a/fixtures/pages-workerjs-directory/vitest.config.ts b/fixtures/pages-workerjs-directory/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-directory/vitest.config.ts rename to fixtures/pages-workerjs-directory/vitest.config.mts diff --git a/fixtures/pages-workerjs-wasm-app/vitest.config.ts b/fixtures/pages-workerjs-wasm-app/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-wasm-app/vitest.config.ts rename to fixtures/pages-workerjs-wasm-app/vitest.config.mts diff --git a/fixtures/pages-workerjs-with-config-file-app/vitest.config.ts b/fixtures/pages-workerjs-with-config-file-app/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-with-config-file-app/vitest.config.ts rename to fixtures/pages-workerjs-with-config-file-app/vitest.config.mts diff --git a/fixtures/pages-workerjs-with-routes-app/vitest.config.ts b/fixtures/pages-workerjs-with-routes-app/vitest.config.mts similarity index 100% rename from fixtures/pages-workerjs-with-routes-app/vitest.config.ts rename to fixtures/pages-workerjs-with-routes-app/vitest.config.mts diff --git a/fixtures/pages-ws-app/vitest.config.ts b/fixtures/pages-ws-app/vitest.config.mts similarity index 100% rename from fixtures/pages-ws-app/vitest.config.ts rename to fixtures/pages-ws-app/vitest.config.mts diff --git a/fixtures/ratelimit-app/vitest.config.ts b/fixtures/ratelimit-app/vitest.config.mts similarity index 100% rename from fixtures/ratelimit-app/vitest.config.ts rename to fixtures/ratelimit-app/vitest.config.mts diff --git a/fixtures/remix-pages-app/vitest.config.ts b/fixtures/remix-pages-app/vitest.config.mts similarity index 100% rename from fixtures/remix-pages-app/vitest.config.ts rename to fixtures/remix-pages-app/vitest.config.mts diff --git a/fixtures/service-bindings-app/vitest.config.ts b/fixtures/service-bindings-app/vitest.config.mts similarity index 100% rename from fixtures/service-bindings-app/vitest.config.ts rename to fixtures/service-bindings-app/vitest.config.mts diff --git a/fixtures/type-generation/vitest.config.ts b/fixtures/type-generation/vitest.config.mts similarity index 100% rename from fixtures/type-generation/vitest.config.ts rename to fixtures/type-generation/vitest.config.mts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts b/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts index d7b66cdcc760..b6ac8dd69a62 100644 --- a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts +++ b/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts @@ -3,7 +3,7 @@ import { expect, it } from "vitest"; it("dispatches fetch event", async () => { // `SELF` here points to the worker running in the current isolate. - // This gets its handler from the `main` option in `vitest.config.ts`. + // This gets its handler from the `main` option in `vitest.config.mts`. // Importantly, it uses the exact `import("../src").default` instance we could // import in this file as its handler. const response = await SELF.fetch("http://example.com"); diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts b/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts index cac59d8dde9d..cddb6b00c665 100644 --- a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts +++ b/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts @@ -3,7 +3,7 @@ import { expect, it } from "vitest"; it("dispatches scheduled event", async () => { // `SELF` here points to the worker running in the current isolate. - // This gets its handler from the `main` option in `vitest.config.ts`. + // This gets its handler from the `main` option in `vitest.config.mts`. // Importantly, it uses the exact `import("../src").default` instance we could // import in this file as its handler. Note the `SELF.scheduled()` method // is experimental, and requires the `service_binding_extra_handlers` diff --git a/fixtures/vitest-pool-workers-examples/d1/README.md b/fixtures/vitest-pool-workers-examples/d1/README.md index c0b41494fc24..c6b6d910b29f 100644 --- a/fixtures/vitest-pool-workers-examples/d1/README.md +++ b/fixtures/vitest-pool-workers-examples/d1/README.md @@ -1,6 +1,6 @@ # 📚 d1 -This Worker implements a simple blog using D1 bindings. It uses migrations for setting up the database. These migrations are read in `vitest.config.ts`, and applied with the [test/apply-migrations.ts](test/apply-migrations.ts) setup file. +This Worker implements a simple blog using D1 bindings. It uses migrations for setting up the database. These migrations are read in `vitest.config.mts`, and applied with the [test/apply-migrations.ts](test/apply-migrations.ts) setup file. | Test | Overview | | --------------------------------------- | -------------------------------- | diff --git a/fixtures/vitest-pool-workers-examples/d1/test/env.d.ts b/fixtures/vitest-pool-workers-examples/d1/test/env.d.ts index 1ccdbbe3d62f..d177afa47e0c 100644 --- a/fixtures/vitest-pool-workers-examples/d1/test/env.d.ts +++ b/fixtures/vitest-pool-workers-examples/d1/test/env.d.ts @@ -1,6 +1,6 @@ declare module "cloudflare:test" { // Controls the type of `import("cloudflare:test").env` interface ProvidedEnv extends Env { - TEST_MIGRATIONS: D1Migration[]; // Defined in `vitest.config.ts` + TEST_MIGRATIONS: D1Migration[]; // Defined in `vitest.config.mts` } } diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/README.md b/fixtures/vitest-pool-workers-examples/hyperdrive/README.md index 3660bfe287f0..74682d1d562f 100644 --- a/fixtures/vitest-pool-workers-examples/hyperdrive/README.md +++ b/fixtures/vitest-pool-workers-examples/hyperdrive/README.md @@ -1,6 +1,6 @@ # 🚀 hyperdrive -This Worker establishes a TCP connection with an echo server via Hyperdrive. The echo server is started/stopped by [global-setup.ts](global-setup.ts) on a random port, which is then provided to [vitest.config.ts](vitest.config.ts). In a real worker, Hyperdrive would be used with a database instead. +This Worker establishes a TCP connection with an echo server via Hyperdrive. The echo server is started/stopped by [global-setup.ts](global-setup.ts) on a random port, which is then provided to [vitest.config.mts](vitest.config.mts). In a real worker, Hyperdrive would be used with a database instead. | Test | Overview | | --------------------------------- | ----------------------------- | diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.toml b/fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.toml index 0c52ae57da59..517015ad6bf9 100644 --- a/fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.toml +++ b/fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.toml @@ -6,4 +6,4 @@ compatibility_flags = ["nodejs_compat"] [[hyperdrive]] binding = "ECHO_SERVER_HYPERDRIVE" id = "00000000000000000000000000000000" -localConnectionString = "postgres://user:pass@127.0.0.1/db" # Overridden in `vitest.config.ts` +localConnectionString = "postgres://user:pass@127.0.0.1/db" # Overridden in `vitest.config.mts` diff --git a/fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts b/fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts index 5f904f51b518..9a6acd89a720 100644 --- a/fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts +++ b/fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts @@ -6,7 +6,7 @@ it("replaces defines from wrangler.toml", async () => { expect(WRANGLER_NESTED.DEFINED.THING).toBe(WRANGLER_NESTED.DEFINED.THING); }); -it("replaces defines from vitest.config.ts", async () => { +it("replaces defines from vitest.config.mts", async () => { expect(CONFIG_DEFINED_THING).toBe("thing"); expect(CONFIG_NESTED.DEFINED.THING).toStrictEqual([1, 2, 3]); expect(CONFIG_NESTED.DEFINED.THING).toBe(CONFIG_NESTED.DEFINED.THING); diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts b/fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts index 400bbd8bc8a6..4b8e62a89196 100644 --- a/fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts +++ b/fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts @@ -1,6 +1,6 @@ declare module "cloudflare:test" { // Controls the type of `import("cloudflare:test").env` interface ProvidedEnv extends Env { - TEST_AUTH_PUBLIC_KEY: string; // Defined in `vitest.config.ts` + TEST_AUTH_PUBLIC_KEY: string; // Defined in `vitest.config.mts` } } diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts b/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts index 612a71d8234f..8234e0e17cbd 100644 --- a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts +++ b/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts @@ -4,7 +4,7 @@ import { describe, expect, it } from "vitest"; describe("functions", () => { it("calls function", async () => { // `SELF` here points to the worker running in the current isolate. - // This gets its handler from the `main` option in `vitest.config.ts`. + // This gets its handler from the `main` option in `vitest.config.mts`. const response = await SELF.fetch("http://example.com/api/ping"); // All `/api/*` requests go through `functions/api/_middleware.ts`, // which makes all response bodies uppercase diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts b/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts index 6af377dabc1e..81a1809b238b 100644 --- a/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts +++ b/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts @@ -4,7 +4,7 @@ import { expect, it } from "vitest"; it("consumes queue messages", async () => { // `SELF` here points to the worker running in the current isolate. - // This gets its handler from the `main` option in `vitest.config.ts`. + // This gets its handler from the `main` option in `vitest.config.mts`. // Importantly, it uses the exact `import("../src").default` instance we could // import in this file as its handler. Note the `SELF.queue()` method // is experimental, and requires the `service_binding_extra_handlers` diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts b/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts index 96cef288877f..6e8c7d3e5070 100644 --- a/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts +++ b/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts @@ -41,7 +41,7 @@ it("produces queue message with mocked send", async () => { it("produces queue message with mocked consumer", async () => { // Intercept calls to `worker.queue()`. Note the runner worker has a queue // consumer configured that gets its handler from the `main` option in - // `vitest.config.ts`. Importantly, this uses the exact `worker` instance + // `vitest.config.mts`. Importantly, this uses the exact `worker` instance // we're spying on here. const consumerSpy = vi .spyOn(worker, "queue") diff --git a/fixtures/vitest-pool-workers-examples/queues/wrangler.toml b/fixtures/vitest-pool-workers-examples/queues/wrangler.toml index 9d16ac6b78ce..222b39986c25 100644 --- a/fixtures/vitest-pool-workers-examples/queues/wrangler.toml +++ b/fixtures/vitest-pool-workers-examples/queues/wrangler.toml @@ -13,4 +13,4 @@ queue = "queue" [[queues.consumers]] queue = "queue" -max_batch_timeout = 3 # Overridden in `vitest.config.ts` +max_batch_timeout = 3 # Overridden in `vitest.config.mts` diff --git a/fixtures/vitest-pool-workers-examples/vitest.workspace.ts b/fixtures/vitest-pool-workers-examples/vitest.workspace.ts index 4c356ec93edc..ed4639590b61 100644 --- a/fixtures/vitest-pool-workers-examples/vitest.workspace.ts +++ b/fixtures/vitest-pool-workers-examples/vitest.workspace.ts @@ -1 +1 @@ -export default ["*/vitest.config.ts"]; +export default ["*/vitest.config.*ts"]; diff --git a/fixtures/worker-app/vitest.config.ts b/fixtures/worker-app/vitest.config.mts similarity index 100% rename from fixtures/worker-app/vitest.config.ts rename to fixtures/worker-app/vitest.config.mts diff --git a/lint-turbo.mjs b/lint-turbo.mjs index 4c8a47df502f..5148a9c99ec1 100644 --- a/lint-turbo.mjs +++ b/lint-turbo.mjs @@ -31,7 +31,10 @@ for (const p of paths) { } // Ensure all packages with a vitest config file have a "test:ci" script - if (existsSync(path.join(p, "vitest.config.ts"))) { + if ( + existsSync(path.join(p, "vitest.config.ts")) || + existsSync(path.join(p, "vitest.config.mts")) + ) { assert( pkg.scripts["test:ci"], `Package "${p}" is missing a "test:ci" script in package.json` diff --git a/packages/cli/vitest.config.ts b/packages/cli/vitest.config.mts similarity index 100% rename from packages/cli/vitest.config.ts rename to packages/cli/vitest.config.mts diff --git a/packages/create-cloudflare/package.json b/packages/create-cloudflare/package.json index e45495b12ce5..61c978d58a2b 100644 --- a/packages/create-cloudflare/package.json +++ b/packages/create-cloudflare/package.json @@ -37,10 +37,10 @@ "test:e2e:pnpm": "pnpm run build && cross-env TEST_PM=pnpm vitest run --config ./vitest-e2e.config.ts", "test:e2e:bun": "pnpm run build && cross-env TEST_PM=bun vitest run --config ./vitest-e2e.config.ts", "test:e2e:yarn": "pnpm run build && cross-env TEST_PM=yarn vitest run --config ./vitest-e2e.config.ts", - "test:unit": "vitest run --config ./vitest.config.ts", - "test:unit:watch": "vitest --config ./vitest.config.ts", + "test:unit": "vitest run --config ./vitest.config.mts", + "test:unit:watch": "vitest --config ./vitest.config.mts", "watch": "node -r esbuild-register scripts/build.ts --watch", - "test:ci": "vitest run --config ./vitest.config.ts" + "test:ci": "vitest run --config ./vitest.config.mts" }, "devDependencies": { "@babel/parser": "^7.21.3", diff --git a/packages/create-cloudflare/templates/hello-world/ts/vitest.config.ts b/packages/create-cloudflare/templates/hello-world/ts/vitest.config.mts similarity index 100% rename from packages/create-cloudflare/templates/hello-world/ts/vitest.config.ts rename to packages/create-cloudflare/templates/hello-world/ts/vitest.config.mts diff --git a/packages/create-cloudflare/vitest.config.ts b/packages/create-cloudflare/vitest.config.mts similarity index 100% rename from packages/create-cloudflare/vitest.config.ts rename to packages/create-cloudflare/vitest.config.mts diff --git a/packages/edge-preview-authenticated-proxy/vitest.config.ts b/packages/edge-preview-authenticated-proxy/vitest.config.mts similarity index 100% rename from packages/edge-preview-authenticated-proxy/vitest.config.ts rename to packages/edge-preview-authenticated-proxy/vitest.config.mts diff --git a/packages/pages-shared/vitest.config.ts b/packages/pages-shared/vitest.config.mts similarity index 100% rename from packages/pages-shared/vitest.config.ts rename to packages/pages-shared/vitest.config.mts diff --git a/packages/vitest-pool-workers/.eslintrc.js b/packages/vitest-pool-workers/.eslintrc.js index 2fc46348db1c..1410e90c546b 100644 --- a/packages/vitest-pool-workers/.eslintrc.js +++ b/packages/vitest-pool-workers/.eslintrc.js @@ -19,7 +19,7 @@ module.exports = { }, }, { - files: "test/**/vitest.config.ts", + files: "test/**/vitest.config.*ts", parserOptions: { ecmaVersion: 2022, sourceType: "module", diff --git a/packages/vitest-pool-workers/src/worker/fetch-mock.ts b/packages/vitest-pool-workers/src/worker/fetch-mock.ts index e3ff9585eb23..a97f67c3bcfa 100644 --- a/packages/vitest-pool-workers/src/worker/fetch-mock.ts +++ b/packages/vitest-pool-workers/src/worker/fetch-mock.ts @@ -37,7 +37,7 @@ setDispatcher((opts, handler) => { // worker. We kind of have to do it this way, as `fetchMock` supports functions // as reply callbacks, and we can't serialise arbitrary functions across worker // boundaries. For mocking requests in other workers, Miniflare's `fetchMock` -// option can be used in the `vitest.config.ts`. +// option can be used in the `vitest.config.mts`. globalThis.fetch = async (input, init) => { const isActive = isMockActive(fetchMock); if (!isActive) { diff --git a/packages/vitest-pool-workers/test/chunking.test.ts b/packages/vitest-pool-workers/test/chunking.test.ts index d48f688607a4..132cb856a5d4 100644 --- a/packages/vitest-pool-workers/test/chunking.test.ts +++ b/packages/vitest-pool-workers/test/chunking.test.ts @@ -10,7 +10,7 @@ test("chunks large WebSocket messages bi-directionally", async ({ const bigText = "xyz".repeat(400_000); await seed({ "big.txt": bigText, - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { diff --git a/packages/vitest-pool-workers/test/console.test.ts b/packages/vitest-pool-workers/test/console.test.ts index 37e11572545e..7a9acfd68ed3 100644 --- a/packages/vitest-pool-workers/test/console.test.ts +++ b/packages/vitest-pool-workers/test/console.test.ts @@ -5,7 +5,7 @@ test.skipIf(process.platform === "win32")( "console.log()s include correct source-mapped locations", async ({ expect, seed, vitestDev }) => { await seed({ - "vitest.config.ts": minimalVitestConfig, + "vitest.config.mts": minimalVitestConfig, "index.test.ts": dedent` import { describe, it } from "vitest"; console.log("global"); @@ -59,7 +59,7 @@ test("console.logs() inside `export default`ed handlers with SELF", async ({ vitestRun, }) => { await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { diff --git a/packages/vitest-pool-workers/test/isolation.test.ts b/packages/vitest-pool-workers/test/isolation.test.ts index 246b3cb4079a..aaee4a474486 100644 --- a/packages/vitest-pool-workers/test/isolation.test.ts +++ b/packages/vitest-pool-workers/test/isolation.test.ts @@ -29,7 +29,7 @@ test("isolated storage with multiple workers", async ({ } } `, - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; import { DeterministicSequencer } from "./sequencer.ts"; @@ -126,7 +126,7 @@ test("isolated storage with single worker", async ({ } } `, - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; import { DeterministicSequencer } from "./sequencer.ts"; @@ -235,7 +235,7 @@ test("shared storage with multiple workers", async ({ } } `, - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; import { DeterministicSequencer } from "./sequencer.ts"; @@ -327,7 +327,7 @@ test( } } `, - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; import { DeterministicSequencer } from "./sequencer.ts"; diff --git a/packages/vitest-pool-workers/test/snapshots.test.ts b/packages/vitest-pool-workers/test/snapshots.test.ts index 21d2a70d4f14..caa6c3aeb535 100644 --- a/packages/vitest-pool-workers/test/snapshots.test.ts +++ b/packages/vitest-pool-workers/test/snapshots.test.ts @@ -9,7 +9,7 @@ test( async ({ expect, seed, vitestRun, tmpPath }) => { // Check writes new snapshots await seed({ - "vitest.config.ts": minimalVitestConfig, + "vitest.config.mts": minimalVitestConfig, "index.test.ts": dedent` import { it, expect } from "vitest"; it("matches snapshot", () => { @@ -117,7 +117,7 @@ test.skipIf(process.platform === "win32")( async ({ expect, seed, vitestRun, tmpPath }) => { // Check writes new snapshots await seed({ - "vitest.config.ts": minimalVitestConfig, + "vitest.config.mts": minimalVitestConfig, "index.test.ts": dedent` import { it, expect } from "vitest"; it("matches snapshot", () => { @@ -146,7 +146,7 @@ test.skipIf(process.platform === "win32")( // Check fails if snapshots differ await seed({ - "vitest.config.ts": minimalVitestConfig, + "vitest.config.mts": minimalVitestConfig, "index.test.ts": dedent` import { it, expect } from "vitest"; it("matches snapshot", () => { diff --git a/packages/vitest-pool-workers/test/validation.test.ts b/packages/vitest-pool-workers/test/validation.test.ts index f9487aa8881c..78357358c23a 100644 --- a/packages/vitest-pool-workers/test/validation.test.ts +++ b/packages/vitest-pool-workers/test/validation.test.ts @@ -9,7 +9,7 @@ test( // Check top-level options validated await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { @@ -29,7 +29,7 @@ test( let result = await vitestRun(); expect(await result.exitCode).toBe(1); let expected = dedent` - TypeError: Unexpected pool options in project ${path.join(tmpPathName, "vitest.config.ts")}: + TypeError: Unexpected pool options in project ${path.join(tmpPathName, "vitest.config.mts")}: { test: { poolOptions: { @@ -51,7 +51,7 @@ test( // Check `miniflare` options validated with correct error paths await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { @@ -70,7 +70,7 @@ test( result = await vitestRun(); expect(await result.exitCode).toBe(1); expected = dedent` - TypeError: Unexpected pool options in project ${path.join(tmpPathName, "vitest.config.ts")}: + TypeError: Unexpected pool options in project ${path.join(tmpPathName, "vitest.config.mts")}: { test: { poolOptions: { @@ -96,7 +96,7 @@ test( // Check messages without Wrangler configuration path defined await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({}); `, @@ -105,13 +105,13 @@ test( let result = await vitestRun(); expect(await result.exitCode).toBe(1); let expected = dedent` - Error: In project ${path.join(tmpPathName, "vitest.config.ts")}, \`test.poolOptions.workers.miniflare.compatibilityFlags\` must contain "export_commonjs_default", or \`test.poolOptions.workers.miniflare.compatibilityDate\` must be >= "2022-10-31". + Error: In project ${path.join(tmpPathName, "vitest.config.mts")}, \`test.poolOptions.workers.miniflare.compatibilityFlags\` must contain "export_commonjs_default", or \`test.poolOptions.workers.miniflare.compatibilityDate\` must be >= "2022-10-31". This flag is required to use \`@cloudflare/vitest-pool-workers\`. `.replaceAll("\t", " "); expect(result.stderr).toMatch(expected); await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { @@ -127,14 +127,14 @@ test( result = await vitestRun(); expect(await result.exitCode).toBe(1); expected = dedent` - Error: In project ${path.join(tmpPathName, "vitest.config.ts")}, \`test.poolOptions.workers.miniflare.compatibilityFlags\` must contain "nodejs_compat". + Error: In project ${path.join(tmpPathName, "vitest.config.mts")}, \`test.poolOptions.workers.miniflare.compatibilityFlags\` must contain "nodejs_compat". This flag is required to use \`@cloudflare/vitest-pool-workers\`. `.replaceAll("\t", " "); expect(result.stderr).toMatch(expected); // Check messages with Wrangler configuration path defined await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { @@ -151,7 +151,7 @@ test( result = await vitestRun(); expect(await result.exitCode).toBe(1); expected = dedent` - Error: In project ${path.join(tmpPathName, "vitest.config.ts")}'s configuration file ${path.join(tmpPathName, "wrangler.toml")}, \`compatibility_flags\` must contain "export_commonjs_default", or \`compatibility_date\` must be >= "2022-10-31". + Error: In project ${path.join(tmpPathName, "vitest.config.mts")}'s configuration file ${path.join(tmpPathName, "wrangler.toml")}, \`compatibility_flags\` must contain "export_commonjs_default", or \`compatibility_date\` must be >= "2022-10-31". This flag is required to use \`@cloudflare/vitest-pool-workers\`. `.replaceAll("\t", " "); expect(result.stderr).toMatch(expected); @@ -164,7 +164,7 @@ test( result = await vitestRun(); expect(await result.exitCode).toBe(1); expected = dedent` - Error: In project ${path.join(tmpPathName, "vitest.config.ts")}'s configuration file ${path.join(tmpPathName, "wrangler.toml")}, \`compatibility_flags\` must contain "nodejs_compat". + Error: In project ${path.join(tmpPathName, "vitest.config.mts")}'s configuration file ${path.join(tmpPathName, "wrangler.toml")}, \`compatibility_flags\` must contain "nodejs_compat". This flag is required to use \`@cloudflare/vitest-pool-workers\`. `.replaceAll("\t", " "); expect(result.stderr).toMatch(expected); @@ -179,7 +179,7 @@ test( // Check with no entrypoint await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { @@ -213,7 +213,7 @@ test( // Check with service worker await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { diff --git a/packages/vitest-pool-workers/test/watch.test.ts b/packages/vitest-pool-workers/test/watch.test.ts index 5781714c7787..e0d846144323 100644 --- a/packages/vitest-pool-workers/test/watch.test.ts +++ b/packages/vitest-pool-workers/test/watch.test.ts @@ -7,7 +7,7 @@ test("automatically re-runs unit tests", async ({ vitestDev, }) => { await seed({ - "vitest.config.ts": minimalVitestConfig, + "vitest.config.mts": minimalVitestConfig, "index.ts": dedent` export default { async fetch(request, env, ctx) { @@ -54,7 +54,7 @@ test("automatically re-runs integration tests", async ({ vitestDev, }) => { await seed({ - "vitest.config.ts": dedent` + "vitest.config.mts": dedent` import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"; export default defineWorkersConfig({ test: { diff --git a/packages/vitest-pool-workers/tsconfig.json b/packages/vitest-pool-workers/tsconfig.json index f16ed68962ee..0240c5ea0c1b 100644 --- a/packages/vitest-pool-workers/tsconfig.json +++ b/packages/vitest-pool-workers/tsconfig.json @@ -15,7 +15,7 @@ "./src/pool/**/*.ts", "./src/shared/**/*.ts", "./test/**/*.ts", - "./vitest.config.ts", + "./vitest.config.*ts", "./vitest.workspace.ts" ] } diff --git a/packages/vitest-pool-workers/vitest.config.ts b/packages/vitest-pool-workers/vitest.config.mts similarity index 100% rename from packages/vitest-pool-workers/vitest.config.ts rename to packages/vitest-pool-workers/vitest.config.mts diff --git a/packages/workers.new/vitest.config.ts b/packages/workers.new/vitest.config.mts similarity index 100% rename from packages/workers.new/vitest.config.ts rename to packages/workers.new/vitest.config.mts diff --git a/packages/wrangler/e2e/vitest.config.ts b/packages/wrangler/e2e/vitest.config.mts similarity index 100% rename from packages/wrangler/e2e/vitest.config.ts rename to packages/wrangler/e2e/vitest.config.mts diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index 45001bdd04ca..596b6c22e611 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -64,7 +64,7 @@ "test": "pnpm run assert-git-version && vitest", "test:ci": "pnpm run test run", "test:debug": "pnpm run test --silent=false --verbose=true", - "test:e2e": "vitest -c ./e2e/vitest.config.ts", + "test:e2e": "vitest -c ./e2e/vitest.config.mts", "test:watch": "pnpm run test --testTimeout=50000 --watch", "type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json" }, diff --git a/packages/wrangler/vitest.config.ts b/packages/wrangler/vitest.config.mts similarity index 100% rename from packages/wrangler/vitest.config.ts rename to packages/wrangler/vitest.config.mts diff --git a/tools/vitest.config.ts b/tools/vitest.config.mts similarity index 100% rename from tools/vitest.config.ts rename to tools/vitest.config.mts diff --git a/vitest.workspace.ts b/vitest.workspace.ts index edbed77fe47a..3095a872ee14 100644 --- a/vitest.workspace.ts +++ b/vitest.workspace.ts @@ -1,5 +1,5 @@ export default [ - "packages/*/vitest.config.ts", - "fixtures/*/vitest.config.ts", - "tools/vitest.config.ts", + "packages/*/vitest.config.mts", + "fixtures/*/vitest.config.mts", + "tools/vitest.config.mts", ];