diff --git a/.changeset/msw-cloudflare-integration.md b/.changeset/msw-cloudflare-integration.md index fec8726de49..1122b4fa034 100644 --- a/.changeset/msw-cloudflare-integration.md +++ b/.changeset/msw-cloudflare-integration.md @@ -1,9 +1,9 @@ --- -"@cloudflare/vitest-pool-workers": minor +"@cloudflare/vitest-plugin": minor --- Mocking requests with MSW in Worker tests now requires MSW >= 2.14 -`@cloudflare/vitest-pool-workers` previously shipped internal shims to make MSW work inside the workerd runtime. MSW 2.14 added that support natively, so those shims have been removed. +`@cloudflare/vitest-plugin` previously shipped internal shims to make MSW work inside the workerd runtime. MSW 2.14 added that support natively, so those shims have been removed. -If you mock requests with MSW in your Worker tests, make sure you're on MSW `>= 2.14`; older versions will no longer intercept requests. You can keep using `setupServer()` from `msw/node`, or adopt the official [`@msw/cloudflare`](https://github.com/mswjs/cloudflare) integration via `setupNetwork()`. See the updated [`request-mocking` example fixture](https://github.com/cloudflare/workers-sdk/tree/main/fixtures/vitest-pool-workers-examples/request-mocking) for the recommended pattern. +If you mock requests with MSW in your Worker tests, make sure you're on MSW `>= 2.14`; older versions will no longer intercept requests. You can keep using `setupServer()` from `msw/node`, or adopt the official [`@msw/cloudflare`](https://github.com/mswjs/cloudflare) integration via `setupNetwork()`. See the updated [`request-mocking` example fixture](https://github.com/cloudflare/workers-sdk/tree/main/fixtures/vitest-plugin-examples/request-mocking) for the recommended pattern. diff --git a/.changeset/rename-vitest-plugin.md b/.changeset/rename-vitest-plugin.md new file mode 100644 index 00000000000..20b54d49bc7 --- /dev/null +++ b/.changeset/rename-vitest-plugin.md @@ -0,0 +1,31 @@ +--- +"@cloudflare/vitest-plugin": major +--- + +Rename `@cloudflare/vitest-pool-workers` to `@cloudflare/vitest-plugin` for the v1 release + +The package has been renamed from `@cloudflare/vitest-pool-workers` to `@cloudflare/vitest-plugin` to better reflect that it is a Vite/Vitest plugin rather than a custom Vitest pool. + +To migrate: + +1. Replace the dependency in your `package.json`: + + ```diff + - "@cloudflare/vitest-pool-workers": "^0.16.0" + + "@cloudflare/vitest-plugin": "^1.0.0" + ``` + +2. Update your imports (a codemod is provided): + + ```sh + npx jscodeshift -t node_modules/@cloudflare/vitest-plugin/dist/codemods/vitest-pool-workers-to-vitest-plugin.mjs vitest.config.ts + ``` + + This rewrites imports such as `import { cloudflareTest } from "@cloudflare/vitest-pool-workers"` to `import { cloudflareTest } from "@cloudflare/vitest-plugin"`, preserving any subpaths. + +3. Update the `types` entry in your test `tsconfig.json`: + + ```diff + - "types": ["@cloudflare/vitest-pool-workers/types"] + + "types": ["@cloudflare/vitest-plugin/types"] + ``` diff --git a/.github/skills/issue-review.md b/.github/skills/issue-review.md index 5984969c8fa..150133d0f24 100644 --- a/.github/skills/issue-review.md +++ b/.github/skills/issue-review.md @@ -238,7 +238,7 @@ Map the issue to a package based on labels, title, and body content: | `package:wrangler` label, wrangler CLI commands, `wrangler.toml`/`wrangler.json` | `packages/wrangler` | | `package:miniflare` label, local dev simulation | `packages/miniflare` | | `product:d1` label, D1 database, `d1 execute`, migrations | `packages/wrangler` (D1 code is in wrangler) | -| `package:vitest` label, worker tests, `vitest-pool-workers` | `packages/vitest-pool-workers` | +| `package:vitest` label, worker tests, `vitest-plugin` | `packages/vitest-plugin` | | `package:vite-plugin` label, vite dev, `@cloudflare/vite-plugin` | `packages/vite-plugin-cloudflare` | | `package:c3` label, `create-cloudflare`, project scaffolding | `packages/create-cloudflare` | | `product:pages` label, Pages deployment, `_routes.json`, `_headers` | `packages/wrangler` (Pages code is in wrangler) | diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index ad538d90fc4..b2e990582a9 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -169,12 +169,12 @@ jobs: - name: Run tests (packages) if: steps.changes.outputs.everything_but_markdown == 'true' && matrix.suite == 'packages-and-tools' - # We skip @cloudflare/vitest-pool-workers tests in CI on Windows because they're very flaky. We still run the vitest-pool-workers-examples fixture, which is a comprehensive set of example tests and gives us a lot of confidence. - # The @cloudflare/vitest-pool-workers tests skipped are things like watch mode, which constantly times out probably due to the github runners in use. + # We skip @cloudflare/vitest-plugin tests in CI on Windows because they're very flaky. We still run the vitest-plugin-examples fixture, which is a comprehensive set of example tests and gives us a lot of confidence. + # The @cloudflare/vitest-plugin tests skipped are things like watch mode, which constantly times out probably due to the github runners in use. # Package tests are well-isolated (separate processes, temp dirs, random ports, MSW mocks) and can safely run in parallel. # Concurrency is capped at 3 to avoid CPU starvation on 4-vCPU CI runners when heavyweight suites - # (wrangler/forks, miniflare/workerd, vitest-pool-workers/Verdaccio) overlap. - run: pnpm run test:ci --log-order=stream --concurrency=3 --filter="./packages/*" ${{ matrix.os == 'windows-latest' && '--filter="!./packages/vitest-pool-workers"' || '' }} + # (wrangler/forks, miniflare/workerd, vitest-plugin/Verdaccio) overlap. + run: pnpm run test:ci --log-order=stream --concurrency=3 --filter="./packages/*" ${{ matrix.os == 'windows-latest' && '--filter="!./packages/vitest-plugin"' || '' }} env: NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ diff --git a/.opencode/agents/bonk.md b/.opencode/agents/bonk.md index 45d5fe3f74f..71e42745317 100644 --- a/.opencode/agents/bonk.md +++ b/.opencode/agents/bonk.md @@ -148,7 +148,7 @@ Use triage mode when you are asked to investigate rather than change code. - Add regression tests for bug fixes. - Run `pnpm test:ci --filter ` for the touched area. - Do not leave `.only()` in tests. -- Use `vitest-pool-workers` when you need actual Workers runtime behavior. +- Use `vitest-plugin` when you need actual Workers runtime behavior. **Git:** diff --git a/.oxfmtrc.jsonc b/.oxfmtrc.jsonc index d73e444f476..00eafd04fb0 100644 --- a/.oxfmtrc.jsonc +++ b/.oxfmtrc.jsonc @@ -48,7 +48,7 @@ "!packages/create-cloudflare/templates*/hello-world/**/*.*", "packages/create-cloudflare/templates*/hello-world/**/worker-configuration.d.ts", - "packages/vitest-pool-workers/scripts/rtti/rtti.js", + "packages/vitest-plugin/scripts/rtti/rtti.js", "packages/vite-plugin-cloudflare/playground/prisma/src/generated", "dist-functions", "vscode.d.ts", diff --git a/AGENTS.md b/AGENTS.md index 4a3c51a13fa..ae2259607ce 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,7 +42,7 @@ This is the **Cloudflare Workers SDK** monorepo containing tools and libraries f **Development & Testing:** -- `packages/vitest-pool-workers/` - Vitest integration for testing Workers in actual runtime +- `packages/vitest-plugin/` - Vitest integration for testing Workers in actual runtime - `packages/chrome-devtools-patches/` - Modified Chrome DevTools for Workers debugging **Shared Libraries:** @@ -124,7 +124,7 @@ This is the **Cloudflare Workers SDK** monorepo containing tools and libraries f - Unit tests with Vitest for all packages - Fixture tests in `/fixtures` directory for filesystem/Worker scenarios - E2E tests require real Cloudflare account credentials -- Use `vitest-pool-workers` for testing actual Workers runtime behavior +- Use `vitest-plugin` for testing actual Workers runtime behavior - Shared vitest config (`vitest.shared.ts`): 50s timeouts, `retry: 1`, `restoreMocks: true` - Vitest 4 pool config: use `maxWorkers: 1` instead of the removed `poolOptions.forks.singleFork: true` when tests must run sequentially - **`expect` must come from test context** — never `import { expect } from "vitest"`: @@ -134,7 +134,7 @@ This is the **Cloudflare Workers SDK** monorepo containing tools and libraries f - When test context is unavailable (e.g. setup files), use `node:assert` instead - E2E vitest configs do NOT set `globals: true` — this rule is critical there; forgetting `{ expect }` in the callback causes `ReferenceError` at runtime - When changing user-facing strings or output messages, update corresponding test snapshots -- New test fixtures in `vitest-pool-workers-examples/` must include a `tsconfig.json` +- New test fixtures in `vitest-plugin-examples/` must include a `tsconfig.json` - Test fixtures serve as user-facing recipes — use clean patterns, avoid type casting where possible - Use the `runInTmpDir()` utility instead of mocking filesystem operations. Real filesystem operations are preferred over mocking. The utility creates isolated temporary directories, handles cleanup automatically in `afterEach` hooks, and allows tests to write actual files and assert against them - Use the `mockConsoleMethods()` helper to capture stdout/stderr. Use the pattern `const std = mockConsoleMethods()` in test setup, then access captured output via `std.out`, `std.err`, `std.warn` properties. Assert against captured output using `expect(std.out).toMatchInlineSnapshot()` @@ -179,7 +179,7 @@ This is the **Cloudflare Workers SDK** monorepo containing tools and libraries f **Package-specific tests:** Most packages have their own test suites **Integration tests:** Use fixtures to test real-world scenarios **E2E tests:** Test against actual Cloudflare services (requires auth) -**Workers runtime tests:** Use vitest-pool-workers for workerd-specific behavior +**Workers runtime tests:** Use vitest-plugin for workerd-specific behavior Run `pnpm check` before submitting changes to ensure all quality gates pass. @@ -227,7 +227,7 @@ Packages with their own AGENTS.md for deeper context: - `packages/miniflare/AGENTS.md` - Worker simulation, embedded workers, build system - `packages/vite-plugin-cloudflare/AGENTS.md` - Plugin architecture, playground setup - `packages/create-cloudflare/AGENTS.md` - Scaffolding, template system -- `packages/vitest-pool-workers/AGENTS.md` - 3-context architecture, cloudflare:test module +- `packages/vitest-plugin/AGENTS.md` - 3-context architecture, cloudflare:test module - `packages/workers-utils/AGENTS.md` - Shared config validation, test helpers When making architectural changes to a package (renaming files, adding entry points, changing build output), update the relevant AGENTS.md to reflect the new structure. diff --git a/README.md b/README.md index 051476e759c..feb90d4d6a2 100644 --- a/README.md +++ b/README.md @@ -122,10 +122,10 @@ npm i https://pkg.pr.new/@cloudflare/vite-plugin@main

-
@cloudflare/vitest-pool-workers

+

@cloudflare/vitest-plugin

``` -npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@main +npm i https://pkg.pr.new/@cloudflare/vitest-plugin@main ```

diff --git a/fixtures/browser-run/package.json b/fixtures/browser-run/package.json index 638083b6b5a..89049d986ee 100644 --- a/fixtures/browser-run/package.json +++ b/fixtures/browser-run/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@cloudflare/playwright": "^1.0.0", "@cloudflare/puppeteer": "^1.0.4", - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "@types/node": "catalog:default", "typescript": "catalog:default", "vitest": "catalog:default", diff --git a/fixtures/vitest-pool-workers-examples/README.md b/fixtures/vitest-plugin-examples/README.md similarity index 96% rename from fixtures/vitest-pool-workers-examples/README.md rename to fixtures/vitest-plugin-examples/README.md index d883b88badf..502a11ee95f 100644 --- a/fixtures/vitest-pool-workers-examples/README.md +++ b/fixtures/vitest-plugin-examples/README.md @@ -1,6 +1,6 @@ -# `@cloudflare/vitest-pool-workers` Examples +# `@cloudflare/vitest-plugin` Examples -This directory contains example projects tested with `@cloudflare/vitest-pool-workers`. It aims to provide the building blocks for you to write tests for your own Workers. +This directory contains example projects tested with `@cloudflare/vitest-plugin`. It aims to provide the building blocks for you to write tests for your own Workers. | Directory | Overview | | --------------------------------------------------------------------------------- | ------------------------------------------------------------------- | diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/README.md b/fixtures/vitest-plugin-examples/ai-vectorize/README.md similarity index 68% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/README.md rename to fixtures/vitest-plugin-examples/ai-vectorize/README.md index e8d3ae2eae7..23f016f6826 100644 --- a/fixtures/vitest-pool-workers-examples/ai-vectorize/README.md +++ b/fixtures/vitest-plugin-examples/ai-vectorize/README.md @@ -1,6 +1,6 @@ # 🤖 AI and Vectorize -This Worker uses the AI and Vectorize bindings. @cloudflare/vitest-pool-workers@^0.8.1 is required to use AI and Vectorize bindings in the Vitest integration. +This Worker uses the AI and Vectorize bindings. `@cloudflare/vitest-plugin` is required to use AI and Vectorize bindings in the Vitest integration. [!WARNING] diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/global-setup.ts b/fixtures/vitest-plugin-examples/ai-vectorize/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/global-setup.ts rename to fixtures/vitest-plugin-examples/ai-vectorize/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/src/env.d.ts b/fixtures/vitest-plugin-examples/ai-vectorize/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/src/env.d.ts rename to fixtures/vitest-plugin-examples/ai-vectorize/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/src/index.ts b/fixtures/vitest-plugin-examples/ai-vectorize/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/src/index.ts rename to fixtures/vitest-plugin-examples/ai-vectorize/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/src/tsconfig.json b/fixtures/vitest-plugin-examples/ai-vectorize/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/src/tsconfig.json rename to fixtures/vitest-plugin-examples/ai-vectorize/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/test/index.spec.ts b/fixtures/vitest-plugin-examples/ai-vectorize/test/index.spec.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/test/index.spec.ts rename to fixtures/vitest-plugin-examples/ai-vectorize/test/index.spec.ts diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/test/tsconfig.json b/fixtures/vitest-plugin-examples/ai-vectorize/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/test/tsconfig.json rename to fixtures/vitest-plugin-examples/ai-vectorize/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/tsconfig.json b/fixtures/vitest-plugin-examples/ai-vectorize/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/tsconfig.json rename to fixtures/vitest-plugin-examples/ai-vectorize/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/vitest.config.ts b/fixtures/vitest-plugin-examples/ai-vectorize/vitest.config.ts similarity index 84% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/vitest.config.ts rename to fixtures/vitest-plugin-examples/ai-vectorize/vitest.config.ts index 1215075acd5..44f0fc92f77 100644 --- a/fixtures/vitest-pool-workers-examples/ai-vectorize/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/ai-vectorize/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/ai-vectorize/wrangler.jsonc b/fixtures/vitest-plugin-examples/ai-vectorize/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/ai-vectorize/wrangler.jsonc rename to fixtures/vitest-plugin-examples/ai-vectorize/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/README.md b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/README.md rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/README.md diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/global-setup.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/global-setup.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/src/index.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/src/index.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/src/tsconfig.json b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/src/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/env.d.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/env.d.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/fetch-integration-auxiliary.test.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/fetch-integration-auxiliary.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/fetch-integration-auxiliary.test.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/fetch-integration-auxiliary.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/scheduled-integration-auxiliary.test.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/scheduled-integration-auxiliary.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/scheduled-integration-auxiliary.test.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/scheduled-integration-auxiliary.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/tsconfig.json b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/test/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/tsconfig.json b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/vitest.config.ts b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/vitest.config.ts similarity index 95% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/vitest.config.ts rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/vitest.config.ts index 3631a5b4a3e..f21f0375bb0 100644 --- a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/wrangler.jsonc b/fixtures/vitest-plugin-examples/basics-integration-auxiliary/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-integration-auxiliary/wrangler.jsonc rename to fixtures/vitest-plugin-examples/basics-integration-auxiliary/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/README.md b/fixtures/vitest-plugin-examples/basics-unit-integration-self/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/README.md rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/README.md diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/env.d.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/env.d.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/greet.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/src/greet.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/greet.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/src/greet.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/index.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/index.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/tsconfig.json b/fixtures/vitest-plugin-examples/basics-unit-integration-self/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/src/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/test/fetch-integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-unit.test.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/test/fetch-unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/fetch-unit.test.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/test/fetch-unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/test/scheduled-integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-unit.test.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/test/scheduled-unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/scheduled-unit.test.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/test/scheduled-unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/tsconfig.json b/fixtures/vitest-plugin-examples/basics-unit-integration-self/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/test/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/tsconfig.json b/fixtures/vitest-plugin-examples/basics-unit-integration-self/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/tsconfig.json rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/vitest.config.ts b/fixtures/vitest-plugin-examples/basics-unit-integration-self/vitest.config.ts similarity index 88% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/vitest.config.ts rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/vitest.config.ts index 3d82d8aa0ae..ee590f5d83a 100644 --- a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/basics-unit-integration-self/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/basics-unit-integration-self/wrangler.jsonc b/fixtures/vitest-plugin-examples/basics-unit-integration-self/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/basics-unit-integration-self/wrangler.jsonc rename to fixtures/vitest-plugin-examples/basics-unit-integration-self/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/container-app/Dockerfile b/fixtures/vitest-plugin-examples/container-app/Dockerfile similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/Dockerfile rename to fixtures/vitest-plugin-examples/container-app/Dockerfile diff --git a/fixtures/vitest-plugin-examples/container-app/README.md b/fixtures/vitest-plugin-examples/container-app/README.md new file mode 100644 index 00000000000..66e9acaf061 --- /dev/null +++ b/fixtures/vitest-plugin-examples/container-app/README.md @@ -0,0 +1,3 @@ +# Apps with no-op containers + +Currently, `vitest-plugin` does not support testing containers yet. It should still let you test your application as long as you do not test with any code paths that interact with containers. diff --git a/fixtures/vitest-pool-workers-examples/container-app/container/simple-node-app.js b/fixtures/vitest-plugin-examples/container-app/container/simple-node-app.js similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/container/simple-node-app.js rename to fixtures/vitest-plugin-examples/container-app/container/simple-node-app.js diff --git a/fixtures/vitest-pool-workers-examples/container-app/src/env.d.ts b/fixtures/vitest-plugin-examples/container-app/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/src/env.d.ts rename to fixtures/vitest-plugin-examples/container-app/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/container-app/src/index.ts b/fixtures/vitest-plugin-examples/container-app/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/src/index.ts rename to fixtures/vitest-plugin-examples/container-app/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/container-app/src/tsconfig.json b/fixtures/vitest-plugin-examples/container-app/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/src/tsconfig.json rename to fixtures/vitest-plugin-examples/container-app/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/container-app/test/container.test.ts b/fixtures/vitest-plugin-examples/container-app/test/container.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/test/container.test.ts rename to fixtures/vitest-plugin-examples/container-app/test/container.test.ts diff --git a/fixtures/vitest-pool-workers-examples/container-app/test/container.unit.test.ts b/fixtures/vitest-plugin-examples/container-app/test/container.unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/test/container.unit.test.ts rename to fixtures/vitest-plugin-examples/container-app/test/container.unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/container-app/test/tsconfig.json b/fixtures/vitest-plugin-examples/container-app/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/test/tsconfig.json rename to fixtures/vitest-plugin-examples/container-app/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/container-app/tsconfig.json b/fixtures/vitest-plugin-examples/container-app/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/tsconfig.json rename to fixtures/vitest-plugin-examples/container-app/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vitest.config.ts b/fixtures/vitest-plugin-examples/container-app/vitest.config.ts similarity index 80% rename from fixtures/vitest-pool-workers-examples/module-resolution/vitest.config.ts rename to fixtures/vitest-plugin-examples/container-app/vitest.config.ts index d9a889a9fdb..c2326d6f5cb 100644 --- a/fixtures/vitest-pool-workers-examples/module-resolution/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/container-app/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/container-app/wrangler.jsonc b/fixtures/vitest-plugin-examples/container-app/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/container-app/wrangler.jsonc rename to fixtures/vitest-plugin-examples/container-app/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/context-exports/README.md b/fixtures/vitest-plugin-examples/context-exports/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/README.md rename to fixtures/vitest-plugin-examples/context-exports/README.md diff --git a/fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/index.ts b/fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/index.ts rename to fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/index.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/tsconfig.json b/fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/tsconfig.json rename to fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/worker-configuration.d.ts b/fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/worker-configuration.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/worker-configuration.d.ts rename to fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/worker-configuration.d.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/wrangler.jsonc b/fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/auxiliary-worker/wrangler.jsonc rename to fixtures/vitest-plugin-examples/context-exports/auxiliary-worker/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/context-exports/global-setup.ts b/fixtures/vitest-plugin-examples/context-exports/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/global-setup.ts rename to fixtures/vitest-plugin-examples/context-exports/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/src/index.ts b/fixtures/vitest-plugin-examples/context-exports/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/src/index.ts rename to fixtures/vitest-plugin-examples/context-exports/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/src/tsconfig.json b/fixtures/vitest-plugin-examples/context-exports/src/tsconfig.json similarity index 76% rename from fixtures/vitest-pool-workers-examples/context-exports/src/tsconfig.json rename to fixtures/vitest-plugin-examples/context-exports/src/tsconfig.json index 38455c03867..b2a3b7f222f 100644 --- a/fixtures/vitest-pool-workers-examples/context-exports/src/tsconfig.json +++ b/fixtures/vitest-plugin-examples/context-exports/src/tsconfig.json @@ -4,7 +4,7 @@ "compilerOptions": { "paths": { // This path is used to simulate a virtual module that Vitest and TypeScript can understand, - // but esbuild (used by the vitest-pool-workers to guess exports) cannot. + // but esbuild (used by the vitest-plugin to guess exports) cannot. "@virtual-module": ["./virtual.ts"] } } diff --git a/fixtures/vitest-pool-workers-examples/context-exports/src/virtual.ts b/fixtures/vitest-plugin-examples/context-exports/src/virtual.ts similarity index 93% rename from fixtures/vitest-pool-workers-examples/context-exports/src/virtual.ts rename to fixtures/vitest-plugin-examples/context-exports/src/virtual.ts index 6766491c193..31c623862ca 100644 --- a/fixtures/vitest-pool-workers-examples/context-exports/src/virtual.ts +++ b/fixtures/vitest-plugin-examples/context-exports/src/virtual.ts @@ -21,7 +21,7 @@ export class ConfiguredVirtualDurableObject extends DurableObject { } } -// Although this export cannot be inferred by esbuild, it is explicitly configured in vitest-pool-workers config via `additionalExports`. +// Although this export cannot be inferred by esbuild, it is explicitly configured in vitest-plugin config via `additionalExports`. export class ConfiguredVirtualEntryPoint extends WorkerEntrypoint { greet() { return `Hello ${this.env.NAME} from ConfiguredVirtualEntryPoint!`; diff --git a/fixtures/vitest-pool-workers-examples/context-exports/src/worker-configuration.d.ts b/fixtures/vitest-plugin-examples/context-exports/src/worker-configuration.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/src/worker-configuration.d.ts rename to fixtures/vitest-plugin-examples/context-exports/src/worker-configuration.d.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/src/wrangler.jsonc b/fixtures/vitest-plugin-examples/context-exports/src/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/src/wrangler.jsonc rename to fixtures/vitest-plugin-examples/context-exports/src/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/context-exports/test/auxiliary.test.ts b/fixtures/vitest-plugin-examples/context-exports/test/auxiliary.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/test/auxiliary.test.ts rename to fixtures/vitest-plugin-examples/context-exports/test/auxiliary.test.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/test/durable-objects.test.ts b/fixtures/vitest-plugin-examples/context-exports/test/durable-objects.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/test/durable-objects.test.ts rename to fixtures/vitest-plugin-examples/context-exports/test/durable-objects.test.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/test/integration-self.test.ts b/fixtures/vitest-plugin-examples/context-exports/test/integration-self.test.ts similarity index 92% rename from fixtures/vitest-pool-workers-examples/context-exports/test/integration-self.test.ts rename to fixtures/vitest-plugin-examples/context-exports/test/integration-self.test.ts index e92516a5460..933cfbb1427 100644 --- a/fixtures/vitest-pool-workers-examples/context-exports/test/integration-self.test.ts +++ b/fixtures/vitest-plugin-examples/context-exports/test/integration-self.test.ts @@ -28,7 +28,7 @@ it("will warn on missing context exports on the main worker", async ({ expect(warnSpy).toHaveBeenCalledWith( "Attempted to access 'ctx.exports.InvalidExport', which was not defined for the main Worker.\n" + "Check that 'InvalidExport' is exported as an entry-point from the Worker.\n" + - "The '@cloudflare/vitest-pool-workers' integration tries to infer these exports by analyzing the source code of the main Worker.\n" + "The '@cloudflare/vitest-plugin' integration tries to infer these exports by analyzing the source code of the main Worker.\n" ); }); @@ -45,7 +45,7 @@ it("will warn on implicit re-exports that will exist in production but cannot no expect(warnSpy).toHaveBeenCalledWith( "Attempted to access 'ctx.exports.ReexportedVirtualEntryPoint', which was not defined for the main Worker.\n" + "Check that 'ReexportedVirtualEntryPoint' is exported as an entry-point from the Worker.\n" + - "The '@cloudflare/vitest-pool-workers' integration tries to infer these exports by analyzing the source code of the main Worker.\n" + "The '@cloudflare/vitest-plugin' integration tries to infer these exports by analyzing the source code of the main Worker.\n" ); }); diff --git a/fixtures/vitest-pool-workers-examples/context-exports/test/tsconfig.json b/fixtures/vitest-plugin-examples/context-exports/test/tsconfig.json similarity index 79% rename from fixtures/vitest-pool-workers-examples/context-exports/test/tsconfig.json rename to fixtures/vitest-plugin-examples/context-exports/test/tsconfig.json index a13714b540e..2adeca9015a 100644 --- a/fixtures/vitest-pool-workers-examples/context-exports/test/tsconfig.json +++ b/fixtures/vitest-plugin-examples/context-exports/test/tsconfig.json @@ -4,7 +4,7 @@ "compilerOptions": { "paths": { // This path is used to simulate a virtual module that Vitest and TypeScript can understand, - // but esbuild (used by the vitest-pool-workers to guess exports) cannot. + // but esbuild (used by the vitest-plugin to guess exports) cannot. "@virtual-module": ["../src/virtual.ts"] } } diff --git a/fixtures/vitest-pool-workers-examples/context-exports/test/unit.test.ts b/fixtures/vitest-plugin-examples/context-exports/test/unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/test/unit.test.ts rename to fixtures/vitest-plugin-examples/context-exports/test/unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/context-exports/tsconfig.json b/fixtures/vitest-plugin-examples/context-exports/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/context-exports/tsconfig.json rename to fixtures/vitest-plugin-examples/context-exports/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/context-exports/vitest.config.ts b/fixtures/vitest-plugin-examples/context-exports/vitest.config.ts similarity index 89% rename from fixtures/vitest-pool-workers-examples/context-exports/vitest.config.ts rename to fixtures/vitest-plugin-examples/context-exports/vitest.config.ts index 6b8c11a8c74..9f0f8b80ad6 100644 --- a/fixtures/vitest-pool-workers-examples/context-exports/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/context-exports/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; @@ -36,7 +36,7 @@ export default mergeConfig( globalSetup: ["./global-setup.ts"], alias: { // This alias is used to simulate a virtual module that Vitest and TypeScript can understand, - // but esbuild (used by the vitest-pool-workers to guess exports) cannot. + // but esbuild (used by the vitest-plugin to guess exports) cannot. "@virtual-module": "./virtual.ts", }, }, diff --git a/fixtures/vitest-pool-workers-examples/d1/README.md b/fixtures/vitest-plugin-examples/d1/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/README.md rename to fixtures/vitest-plugin-examples/d1/README.md diff --git a/fixtures/vitest-pool-workers-examples/d1/migrations/0000_initial.sql b/fixtures/vitest-plugin-examples/d1/migrations/0000_initial.sql similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/migrations/0000_initial.sql rename to fixtures/vitest-plugin-examples/d1/migrations/0000_initial.sql diff --git a/fixtures/vitest-pool-workers-examples/d1/migrations/0001_admin.sql b/fixtures/vitest-plugin-examples/d1/migrations/0001_admin.sql similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/migrations/0001_admin.sql rename to fixtures/vitest-plugin-examples/d1/migrations/0001_admin.sql diff --git a/fixtures/vitest-pool-workers-examples/d1/src/env.d.ts b/fixtures/vitest-plugin-examples/d1/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/src/env.d.ts rename to fixtures/vitest-plugin-examples/d1/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/src/index.ts b/fixtures/vitest-plugin-examples/d1/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/src/index.ts rename to fixtures/vitest-plugin-examples/d1/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/src/tsconfig.json b/fixtures/vitest-plugin-examples/d1/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/src/tsconfig.json rename to fixtures/vitest-plugin-examples/d1/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/d1/src/utils.ts b/fixtures/vitest-plugin-examples/d1/src/utils.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/src/utils.ts rename to fixtures/vitest-plugin-examples/d1/src/utils.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/test/apply-migrations.ts b/fixtures/vitest-plugin-examples/d1/test/apply-migrations.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/test/apply-migrations.ts rename to fixtures/vitest-plugin-examples/d1/test/apply-migrations.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/test/env.d.ts b/fixtures/vitest-plugin-examples/d1/test/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/test/env.d.ts rename to fixtures/vitest-plugin-examples/d1/test/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/test/queries.test.ts b/fixtures/vitest-plugin-examples/d1/test/queries.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/test/queries.test.ts rename to fixtures/vitest-plugin-examples/d1/test/queries.test.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/test/routes.test.ts b/fixtures/vitest-plugin-examples/d1/test/routes.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/test/routes.test.ts rename to fixtures/vitest-plugin-examples/d1/test/routes.test.ts diff --git a/fixtures/vitest-pool-workers-examples/d1/test/tsconfig.json b/fixtures/vitest-plugin-examples/d1/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/test/tsconfig.json rename to fixtures/vitest-plugin-examples/d1/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/d1/tsconfig.json b/fixtures/vitest-plugin-examples/d1/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/tsconfig.json rename to fixtures/vitest-plugin-examples/d1/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/d1/vitest.config.ts b/fixtures/vitest-plugin-examples/d1/vitest.config.ts similarity index 90% rename from fixtures/vitest-pool-workers-examples/d1/vitest.config.ts rename to fixtures/vitest-plugin-examples/d1/vitest.config.ts index 0d05cabc08a..a836da3b033 100644 --- a/fixtures/vitest-pool-workers-examples/d1/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/d1/vitest.config.ts @@ -1,8 +1,5 @@ import path from "node:path"; -import { - cloudflareTest, - readD1Migrations, -} from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest, readD1Migrations } from "@cloudflare/vitest-plugin"; import { defineConfig, defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/d1/wrangler.jsonc b/fixtures/vitest-plugin-examples/d1/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/d1/wrangler.jsonc rename to fixtures/vitest-plugin-examples/d1/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/README.md b/fixtures/vitest-plugin-examples/durable-objects-exports/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/README.md rename to fixtures/vitest-plugin-examples/durable-objects-exports/README.md diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/src/env.d.ts b/fixtures/vitest-plugin-examples/durable-objects-exports/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/src/env.d.ts rename to fixtures/vitest-plugin-examples/durable-objects-exports/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/src/index.ts b/fixtures/vitest-plugin-examples/durable-objects-exports/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/src/index.ts rename to fixtures/vitest-plugin-examples/durable-objects-exports/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/src/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects-exports/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/src/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects-exports/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/test/exports.test.ts b/fixtures/vitest-plugin-examples/durable-objects-exports/test/exports.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/test/exports.test.ts rename to fixtures/vitest-plugin-examples/durable-objects-exports/test/exports.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/test/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects-exports/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/test/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects-exports/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects-exports/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects-exports/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/vitest.config.ts b/fixtures/vitest-plugin-examples/durable-objects-exports/vitest.config.ts similarity index 83% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/vitest.config.ts rename to fixtures/vitest-plugin-examples/durable-objects-exports/vitest.config.ts index dfaddb163f5..0c1526c94fc 100644 --- a/fixtures/vitest-pool-workers-examples/durable-objects-exports/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/durable-objects-exports/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/durable-objects-exports/wrangler.jsonc b/fixtures/vitest-plugin-examples/durable-objects-exports/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects-exports/wrangler.jsonc rename to fixtures/vitest-plugin-examples/durable-objects-exports/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/README.md b/fixtures/vitest-plugin-examples/durable-objects/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/README.md rename to fixtures/vitest-plugin-examples/durable-objects/README.md diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/src/env.d.ts b/fixtures/vitest-plugin-examples/durable-objects/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/src/env.d.ts rename to fixtures/vitest-plugin-examples/durable-objects/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/src/index.ts b/fixtures/vitest-plugin-examples/durable-objects/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/src/index.ts rename to fixtures/vitest-plugin-examples/durable-objects/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/src/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/src/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/alarm.test.ts b/fixtures/vitest-plugin-examples/durable-objects/test/alarm.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/alarm.test.ts rename to fixtures/vitest-plugin-examples/durable-objects/test/alarm.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/direct-access.test.ts b/fixtures/vitest-plugin-examples/durable-objects/test/direct-access.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/direct-access.test.ts rename to fixtures/vitest-plugin-examples/durable-objects/test/direct-access.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/eviction.test.ts b/fixtures/vitest-plugin-examples/durable-objects/test/eviction.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/eviction.test.ts rename to fixtures/vitest-plugin-examples/durable-objects/test/eviction.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/sqlite-in-do.test.ts b/fixtures/vitest-plugin-examples/durable-objects/test/sqlite-in-do.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/sqlite-in-do.test.ts rename to fixtures/vitest-plugin-examples/durable-objects/test/sqlite-in-do.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/test/websockets.test.ts b/fixtures/vitest-plugin-examples/durable-objects/test/websockets.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/test/websockets.test.ts rename to fixtures/vitest-plugin-examples/durable-objects/test/websockets.test.ts diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/tsconfig.json b/fixtures/vitest-plugin-examples/durable-objects/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/tsconfig.json rename to fixtures/vitest-plugin-examples/durable-objects/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/vitest.config.ts b/fixtures/vitest-plugin-examples/durable-objects/vitest.config.ts similarity index 83% rename from fixtures/vitest-pool-workers-examples/durable-objects/vitest.config.ts rename to fixtures/vitest-plugin-examples/durable-objects/vitest.config.ts index ce613dc6b87..be9f15f0a5b 100644 --- a/fixtures/vitest-pool-workers-examples/durable-objects/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/durable-objects/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/durable-objects/wrangler.jsonc b/fixtures/vitest-plugin-examples/durable-objects/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/durable-objects/wrangler.jsonc rename to fixtures/vitest-plugin-examples/durable-objects/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/src/greeting.ts b/fixtures/vitest-plugin-examples/dynamic-import/src/greeting.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/src/greeting.ts rename to fixtures/vitest-plugin-examples/dynamic-import/src/greeting.ts diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/src/index.ts b/fixtures/vitest-plugin-examples/dynamic-import/src/index.ts similarity index 91% rename from fixtures/vitest-pool-workers-examples/dynamic-import/src/index.ts rename to fixtures/vitest-plugin-examples/dynamic-import/src/index.ts index f50ae2322fc..80cab2dc88e 100644 --- a/fixtures/vitest-pool-workers-examples/dynamic-import/src/index.ts +++ b/fixtures/vitest-plugin-examples/dynamic-import/src/index.ts @@ -16,7 +16,7 @@ export default { _ctx: ExecutionContext ): Promise { // Dynamic import inside a fetch handler — this is the pattern that - // triggers the cross-DO I/O violation in vitest-pool-workers 0.13.x + // triggers the cross-DO I/O violation in vitest-plugin 0.13.x // when called via `exports.default.fetch()` in tests. // See: https://github.com/cloudflare/workers-sdk/issues/12924 const { greet } = await import("./greeting"); diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/src/tsconfig.json b/fixtures/vitest-plugin-examples/dynamic-import/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/src/tsconfig.json rename to fixtures/vitest-plugin-examples/dynamic-import/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/src/worker-configuration.d.ts b/fixtures/vitest-plugin-examples/dynamic-import/src/worker-configuration.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/src/worker-configuration.d.ts rename to fixtures/vitest-plugin-examples/dynamic-import/src/worker-configuration.d.ts diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/test/dynamic-import.test.ts b/fixtures/vitest-plugin-examples/dynamic-import/test/dynamic-import.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/test/dynamic-import.test.ts rename to fixtures/vitest-plugin-examples/dynamic-import/test/dynamic-import.test.ts diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/test/tsconfig.json b/fixtures/vitest-plugin-examples/dynamic-import/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/test/tsconfig.json rename to fixtures/vitest-plugin-examples/dynamic-import/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/tsconfig.json b/fixtures/vitest-plugin-examples/dynamic-import/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/tsconfig.json rename to fixtures/vitest-plugin-examples/dynamic-import/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pipelines/vitest.config.ts b/fixtures/vitest-plugin-examples/dynamic-import/vitest.config.ts similarity index 81% rename from fixtures/vitest-pool-workers-examples/pipelines/vitest.config.ts rename to fixtures/vitest-plugin-examples/dynamic-import/vitest.config.ts index 42170624230..877bda7df9f 100644 --- a/fixtures/vitest-pool-workers-examples/pipelines/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/dynamic-import/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/wrangler.jsonc b/fixtures/vitest-plugin-examples/dynamic-import/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/dynamic-import/wrangler.jsonc rename to fixtures/vitest-plugin-examples/dynamic-import/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/README.md b/fixtures/vitest-plugin-examples/hyperdrive/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/README.md rename to fixtures/vitest-plugin-examples/hyperdrive/README.md diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/env.d.ts b/fixtures/vitest-plugin-examples/hyperdrive/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/env.d.ts rename to fixtures/vitest-plugin-examples/hyperdrive/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/global-setup.ts b/fixtures/vitest-plugin-examples/hyperdrive/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/global-setup.ts rename to fixtures/vitest-plugin-examples/hyperdrive/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/src/env.d.ts b/fixtures/vitest-plugin-examples/hyperdrive/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/src/env.d.ts rename to fixtures/vitest-plugin-examples/hyperdrive/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/src/index.ts b/fixtures/vitest-plugin-examples/hyperdrive/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/src/index.ts rename to fixtures/vitest-plugin-examples/hyperdrive/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/src/tsconfig.json b/fixtures/vitest-plugin-examples/hyperdrive/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/src/tsconfig.json rename to fixtures/vitest-plugin-examples/hyperdrive/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/test/echo.test.ts b/fixtures/vitest-plugin-examples/hyperdrive/test/echo.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/test/echo.test.ts rename to fixtures/vitest-plugin-examples/hyperdrive/test/echo.test.ts diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/test/tsconfig.json b/fixtures/vitest-plugin-examples/hyperdrive/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/test/tsconfig.json rename to fixtures/vitest-plugin-examples/hyperdrive/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/tsconfig.json b/fixtures/vitest-plugin-examples/hyperdrive/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/tsconfig.json rename to fixtures/vitest-plugin-examples/hyperdrive/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/vitest.config.ts b/fixtures/vitest-plugin-examples/hyperdrive/vitest.config.ts similarity index 90% rename from fixtures/vitest-pool-workers-examples/hyperdrive/vitest.config.ts rename to fixtures/vitest-plugin-examples/hyperdrive/vitest.config.ts index c2be5c378ce..2216b12686e 100644 --- a/fixtures/vitest-pool-workers-examples/hyperdrive/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/hyperdrive/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.jsonc b/fixtures/vitest-plugin-examples/hyperdrive/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/hyperdrive/wrangler.jsonc rename to fixtures/vitest-plugin-examples/hyperdrive/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/images/README.md b/fixtures/vitest-plugin-examples/images/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/README.md rename to fixtures/vitest-plugin-examples/images/README.md diff --git a/fixtures/vitest-pool-workers-examples/images/src/env.d.ts b/fixtures/vitest-plugin-examples/images/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/src/env.d.ts rename to fixtures/vitest-plugin-examples/images/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/images/src/index.ts b/fixtures/vitest-plugin-examples/images/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/src/index.ts rename to fixtures/vitest-plugin-examples/images/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/images/src/tsconfig.json b/fixtures/vitest-plugin-examples/images/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/src/tsconfig.json rename to fixtures/vitest-plugin-examples/images/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/images/test/images.test.ts b/fixtures/vitest-plugin-examples/images/test/images.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/test/images.test.ts rename to fixtures/vitest-plugin-examples/images/test/images.test.ts diff --git a/fixtures/vitest-pool-workers-examples/images/test/tsconfig.json b/fixtures/vitest-plugin-examples/images/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/test/tsconfig.json rename to fixtures/vitest-plugin-examples/images/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/images/tsconfig.json b/fixtures/vitest-plugin-examples/images/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/tsconfig.json rename to fixtures/vitest-plugin-examples/images/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/images/vitest.config.ts b/fixtures/vitest-plugin-examples/images/vitest.config.ts similarity index 81% rename from fixtures/vitest-pool-workers-examples/images/vitest.config.ts rename to fixtures/vitest-plugin-examples/images/vitest.config.ts index 42170624230..877bda7df9f 100644 --- a/fixtures/vitest-pool-workers-examples/images/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/images/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/images/wrangler.jsonc b/fixtures/vitest-plugin-examples/images/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/images/wrangler.jsonc rename to fixtures/vitest-plugin-examples/images/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/README.md b/fixtures/vitest-plugin-examples/kv-r2-caches/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/README.md rename to fixtures/vitest-plugin-examples/kv-r2-caches/README.md diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/src/env.d.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/src/env.d.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/src/helpers.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/src/helpers.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/src/helpers.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/src/helpers.ts diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/src/index.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/src/index.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/src/tsconfig.json b/fixtures/vitest-plugin-examples/kv-r2-caches/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/src/tsconfig.json rename to fixtures/vitest-plugin-examples/kv-r2-caches/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/test/kv.test.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/test/kv.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/test/kv.test.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/test/kv.test.ts diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/test/r2.test.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/test/r2.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/test/r2.test.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/test/r2.test.ts diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/test/tsconfig.json b/fixtures/vitest-plugin-examples/kv-r2-caches/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/test/tsconfig.json rename to fixtures/vitest-plugin-examples/kv-r2-caches/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/tsconfig.json b/fixtures/vitest-plugin-examples/kv-r2-caches/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/tsconfig.json rename to fixtures/vitest-plugin-examples/kv-r2-caches/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/dynamic-import/vitest.config.ts b/fixtures/vitest-plugin-examples/kv-r2-caches/vitest.config.ts similarity index 81% rename from fixtures/vitest-pool-workers-examples/dynamic-import/vitest.config.ts rename to fixtures/vitest-plugin-examples/kv-r2-caches/vitest.config.ts index 42170624230..877bda7df9f 100644 --- a/fixtures/vitest-pool-workers-examples/dynamic-import/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/kv-r2-caches/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/wrangler.jsonc b/fixtures/vitest-plugin-examples/kv-r2-caches/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/wrangler.jsonc rename to fixtures/vitest-plugin-examples/kv-r2-caches/wrangler.jsonc diff --git a/fixtures/vitest-plugin-examples/misc/README.md b/fixtures/vitest-plugin-examples/misc/README.md new file mode 100644 index 00000000000..77afc3e206f --- /dev/null +++ b/fixtures/vitest-plugin-examples/misc/README.md @@ -0,0 +1,3 @@ +# 🤷 misc + +We run all the tests in `vitest-plugin-examples` on every change to `workers-sdk`. This directory contains a bunch of tests to validate assorted Vitest features that aren't tested elsewhere. diff --git a/fixtures/vitest-pool-workers-examples/misc/global-setup.ts b/fixtures/vitest-plugin-examples/misc/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/global-setup.ts rename to fixtures/vitest-plugin-examples/misc/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/public/test.txt b/fixtures/vitest-plugin-examples/misc/public/test.txt similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/public/test.txt rename to fixtures/vitest-plugin-examples/misc/public/test.txt diff --git a/fixtures/vitest-pool-workers-examples/misc/src/other-worker.mjs b/fixtures/vitest-plugin-examples/misc/src/other-worker.mjs similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/src/other-worker.mjs rename to fixtures/vitest-plugin-examples/misc/src/other-worker.mjs diff --git a/fixtures/vitest-pool-workers-examples/misc/test/bare-specifiers.test.ts b/fixtures/vitest-plugin-examples/misc/test/bare-specifiers.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/bare-specifiers.test.ts rename to fixtures/vitest-plugin-examples/misc/test/bare-specifiers.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts b/fixtures/vitest-plugin-examples/misc/test/defines.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/defines.test.ts rename to fixtures/vitest-plugin-examples/misc/test/defines.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/durable-objects.test.ts b/fixtures/vitest-plugin-examples/misc/test/durable-objects.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/durable-objects.test.ts rename to fixtures/vitest-plugin-examples/misc/test/durable-objects.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/env.d.ts b/fixtures/vitest-plugin-examples/misc/test/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/env.d.ts rename to fixtures/vitest-plugin-examples/misc/test/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/fake-timers.test.ts b/fixtures/vitest-plugin-examples/misc/test/fake-timers.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/fake-timers.test.ts rename to fixtures/vitest-plugin-examples/misc/test/fake-timers.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/global.d.ts b/fixtures/vitest-plugin-examples/misc/test/global.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/global.d.ts rename to fixtures/vitest-plugin-examples/misc/test/global.d.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/large-provide.test.ts b/fixtures/vitest-plugin-examples/misc/test/large-provide.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/large-provide.test.ts rename to fixtures/vitest-plugin-examples/misc/test/large-provide.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/module-mocking.test.ts b/fixtures/vitest-plugin-examples/misc/test/module-mocking.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/module-mocking.test.ts rename to fixtures/vitest-plugin-examples/misc/test/module-mocking.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/msw.test.ts b/fixtures/vitest-plugin-examples/misc/test/msw.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/msw.test.ts rename to fixtures/vitest-plugin-examples/misc/test/msw.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/nodejs.test.ts b/fixtures/vitest-plugin-examples/misc/test/nodejs.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/nodejs.test.ts rename to fixtures/vitest-plugin-examples/misc/test/nodejs.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/pages-functions.test.ts b/fixtures/vitest-plugin-examples/misc/test/pages-functions.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/pages-functions.test.ts rename to fixtures/vitest-plugin-examples/misc/test/pages-functions.test.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/server.ts b/fixtures/vitest-plugin-examples/misc/test/server.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/server.ts rename to fixtures/vitest-plugin-examples/misc/test/server.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/setup.ts b/fixtures/vitest-plugin-examples/misc/test/setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/setup.ts rename to fixtures/vitest-plugin-examples/misc/test/setup.ts diff --git a/fixtures/vitest-pool-workers-examples/misc/test/tsconfig.json b/fixtures/vitest-plugin-examples/misc/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/test/tsconfig.json rename to fixtures/vitest-plugin-examples/misc/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/misc/tsconfig.json b/fixtures/vitest-plugin-examples/misc/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/tsconfig.json rename to fixtures/vitest-plugin-examples/misc/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/misc/vitest.assets.config.ts b/fixtures/vitest-plugin-examples/misc/vitest.assets.config.ts similarity index 87% rename from fixtures/vitest-pool-workers-examples/misc/vitest.assets.config.ts rename to fixtures/vitest-plugin-examples/misc/vitest.assets.config.ts index 597a234240a..a4aca21adec 100644 --- a/fixtures/vitest-pool-workers-examples/misc/vitest.assets.config.ts +++ b/fixtures/vitest-plugin-examples/misc/vitest.assets.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/misc/vitest.config.ts b/fixtures/vitest-plugin-examples/misc/vitest.config.ts similarity index 93% rename from fixtures/vitest-pool-workers-examples/misc/vitest.config.ts rename to fixtures/vitest-plugin-examples/misc/vitest.config.ts index a2494785af4..beb466e4f8c 100644 --- a/fixtures/vitest-pool-workers-examples/misc/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/misc/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { Response } from "miniflare"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/misc/vitest.nodejs.config.ts b/fixtures/vitest-plugin-examples/misc/vitest.nodejs.config.ts similarity index 84% rename from fixtures/vitest-pool-workers-examples/misc/vitest.nodejs.config.ts rename to fixtures/vitest-plugin-examples/misc/vitest.nodejs.config.ts index 4c33e225bf5..19e21aa35c9 100644 --- a/fixtures/vitest-pool-workers-examples/misc/vitest.nodejs.config.ts +++ b/fixtures/vitest-plugin-examples/misc/vitest.nodejs.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/misc/wrangler.assets.jsonc b/fixtures/vitest-plugin-examples/misc/wrangler.assets.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/wrangler.assets.jsonc rename to fixtures/vitest-plugin-examples/misc/wrangler.assets.jsonc diff --git a/fixtures/vitest-pool-workers-examples/misc/wrangler.jsonc b/fixtures/vitest-plugin-examples/misc/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/wrangler.jsonc rename to fixtures/vitest-plugin-examples/misc/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/misc/wrangler.nodejs.jsonc b/fixtures/vitest-plugin-examples/misc/wrangler.nodejs.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/misc/wrangler.nodejs.jsonc rename to fixtures/vitest-plugin-examples/misc/wrangler.nodejs.jsonc diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/README.md b/fixtures/vitest-plugin-examples/module-resolution/README.md similarity index 95% rename from fixtures/vitest-pool-workers-examples/module-resolution/README.md rename to fixtures/vitest-plugin-examples/module-resolution/README.md index a2c86725e6a..a3302771f09 100644 --- a/fixtures/vitest-pool-workers-examples/module-resolution/README.md +++ b/fixtures/vitest-plugin-examples/module-resolution/README.md @@ -11,7 +11,7 @@ This fixture demonstrates that the Vitest integration correctly resolves modules [Dependency Pre-Bundling](https://vite.dev/guide/dep-pre-bundling) is a Vite feature that converts dependencies shipped as CommonJS or UMD into ESM. If you encounter module resolution issues—such as: `Error: Cannot use require() to import an ES Module` or `Error: No such module`—you can pre-bundle these dependencies using the [deps.optimizer](https://vitest.dev/config/#deps-optimizer) option: ```ts -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/src/env.d.ts b/fixtures/vitest-plugin-examples/module-resolution/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/src/env.d.ts rename to fixtures/vitest-plugin-examples/module-resolution/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/src/index.ts b/fixtures/vitest-plugin-examples/module-resolution/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/src/index.ts rename to fixtures/vitest-plugin-examples/module-resolution/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/src/test.sql b/fixtures/vitest-plugin-examples/module-resolution/src/test.sql similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/src/test.sql rename to fixtures/vitest-plugin-examples/module-resolution/src/test.sql diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/src/tsconfig.json b/fixtures/vitest-plugin-examples/module-resolution/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/src/tsconfig.json rename to fixtures/vitest-plugin-examples/module-resolution/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/test/index.d.ts b/fixtures/vitest-plugin-examples/module-resolution/test/index.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/test/index.d.ts rename to fixtures/vitest-plugin-examples/module-resolution/test/index.d.ts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/test/index.spec.ts b/fixtures/vitest-plugin-examples/module-resolution/test/index.spec.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/test/index.spec.ts rename to fixtures/vitest-plugin-examples/module-resolution/test/index.spec.ts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/test/tsconfig.json b/fixtures/vitest-plugin-examples/module-resolution/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/test/tsconfig.json rename to fixtures/vitest-plugin-examples/module-resolution/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/tsconfig.json b/fixtures/vitest-plugin-examples/module-resolution/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/tsconfig.json rename to fixtures/vitest-plugin-examples/module-resolution/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/src/add.wasm b/fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/add.wasm similarity index 79% rename from fixtures/vitest-pool-workers-examples/web-assembly/src/add.wasm rename to fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/add.wasm index fa370ae4187..e030b967ba6 100644 Binary files a/fixtures/vitest-pool-workers-examples/web-assembly/src/add.wasm and b/fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/add.wasm differ diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/index.d.ts b/fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/index.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/index.d.ts rename to fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/index.d.ts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/index.js b/fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/index.js similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/index.js rename to fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/index.js diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/package.json b/fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/package.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/package.json rename to fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep/package.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/index.d.mts b/fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/index.d.mts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/index.d.mts rename to fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/index.d.mts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/index.mjs b/fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/index.mjs similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/index.mjs rename to fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/index.mjs diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/package.json b/fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/package.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/package.json rename to fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/package.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/value.mjs b/fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/value.mjs similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep/value.mjs rename to fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep/value.mjs diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/index.js b/fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/index.js similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/index.js rename to fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/index.js diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/package.json b/fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/package.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/package.json rename to fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/package.json diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/subfolder/index.js b/fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/subfolder/index.js similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep/subfolder/index.js rename to fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep/subfolder/index.js diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/add.wasm b/fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/add.wasm similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep/add.wasm rename to fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/add.wasm diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/index.d.mts b/fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/index.d.mts similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/index.d.mts rename to fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/index.d.mts diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/index.mjs b/fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/index.mjs similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/index.mjs rename to fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/index.mjs diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/package.json b/fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/package.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/package.json rename to fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep/package.json diff --git a/fixtures/vitest-pool-workers-examples/container-app/vitest.config.ts b/fixtures/vitest-plugin-examples/module-resolution/vitest.config.ts similarity index 80% rename from fixtures/vitest-pool-workers-examples/container-app/vitest.config.ts rename to fixtures/vitest-plugin-examples/module-resolution/vitest.config.ts index d9a889a9fdb..c2326d6f5cb 100644 --- a/fixtures/vitest-pool-workers-examples/container-app/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/module-resolution/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/wrangler.jsonc b/fixtures/vitest-plugin-examples/module-resolution/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/wrangler.jsonc rename to fixtures/vitest-plugin-examples/module-resolution/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/README.md b/fixtures/vitest-plugin-examples/multiple-workers/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/README.md rename to fixtures/vitest-plugin-examples/multiple-workers/README.md diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/env.d.ts b/fixtures/vitest-plugin-examples/multiple-workers/api-service/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/env.d.ts rename to fixtures/vitest-plugin-examples/multiple-workers/api-service/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/index.ts b/fixtures/vitest-plugin-examples/multiple-workers/api-service/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/index.ts rename to fixtures/vitest-plugin-examples/multiple-workers/api-service/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/tsconfig.json b/fixtures/vitest-plugin-examples/multiple-workers/api-service/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/api-service/src/tsconfig.json rename to fixtures/vitest-plugin-examples/multiple-workers/api-service/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/api-service/wrangler.jsonc b/fixtures/vitest-plugin-examples/multiple-workers/api-service/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/api-service/wrangler.jsonc rename to fixtures/vitest-plugin-examples/multiple-workers/api-service/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/env.d.ts b/fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/env.d.ts rename to fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/index.ts b/fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/index.ts rename to fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/tsconfig.json b/fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/src/tsconfig.json rename to fixtures/vitest-plugin-examples/multiple-workers/auth-service/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/wrangler.jsonc b/fixtures/vitest-plugin-examples/multiple-workers/auth-service/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/auth-service/wrangler.jsonc rename to fixtures/vitest-plugin-examples/multiple-workers/auth-service/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/env.d.ts b/fixtures/vitest-plugin-examples/multiple-workers/database-service/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/env.d.ts rename to fixtures/vitest-plugin-examples/multiple-workers/database-service/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/index.ts b/fixtures/vitest-plugin-examples/multiple-workers/database-service/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/index.ts rename to fixtures/vitest-plugin-examples/multiple-workers/database-service/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/tsconfig.json b/fixtures/vitest-plugin-examples/multiple-workers/database-service/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/database-service/src/tsconfig.json rename to fixtures/vitest-plugin-examples/multiple-workers/database-service/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/database-service/wrangler.jsonc b/fixtures/vitest-plugin-examples/multiple-workers/database-service/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/database-service/wrangler.jsonc rename to fixtures/vitest-plugin-examples/multiple-workers/database-service/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/global-setup.ts b/fixtures/vitest-plugin-examples/multiple-workers/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/global-setup.ts rename to fixtures/vitest-plugin-examples/multiple-workers/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts b/fixtures/vitest-plugin-examples/multiple-workers/test/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/test/env.d.ts rename to fixtures/vitest-plugin-examples/multiple-workers/test/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/test/integration.test.ts b/fixtures/vitest-plugin-examples/multiple-workers/test/integration.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/test/integration.test.ts rename to fixtures/vitest-plugin-examples/multiple-workers/test/integration.test.ts diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/test/tsconfig.json b/fixtures/vitest-plugin-examples/multiple-workers/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/test/tsconfig.json rename to fixtures/vitest-plugin-examples/multiple-workers/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/tsconfig.json b/fixtures/vitest-plugin-examples/multiple-workers/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/multiple-workers/tsconfig.json rename to fixtures/vitest-plugin-examples/multiple-workers/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/multiple-workers/vitest.config.ts b/fixtures/vitest-plugin-examples/multiple-workers/vitest.config.ts similarity index 98% rename from fixtures/vitest-pool-workers-examples/multiple-workers/vitest.config.ts rename to fixtures/vitest-plugin-examples/multiple-workers/vitest.config.ts index 40585520c51..0c5cbb2a99a 100644 --- a/fixtures/vitest-pool-workers-examples/multiple-workers/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/multiple-workers/vitest.config.ts @@ -1,5 +1,5 @@ import crypto from "node:crypto"; -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { importPKCS8, SignJWT } from "jose"; import { Request, Response } from "miniflare"; import { defineProject, mergeConfig } from "vitest/config"; diff --git a/fixtures/vitest-pool-workers-examples/package.json b/fixtures/vitest-plugin-examples/package.json similarity index 97% rename from fixtures/vitest-pool-workers-examples/package.json rename to fixtures/vitest-plugin-examples/package.json index cd31434f91a..1836fb9f1d3 100644 --- a/fixtures/vitest-pool-workers-examples/package.json +++ b/fixtures/vitest-plugin-examples/package.json @@ -1,5 +1,5 @@ { - "name": "@fixture/vitest-pool-workers", + "name": "@fixture/vitest-plugin-examples", "private": true, "type": "module", "scripts": { @@ -35,7 +35,7 @@ "devDependencies": { "@better-auth/stripe": "^1.4.6", "@cloudflare/containers": "^0.2.2", - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "@cloudflare/workers-types": "catalog:default", "@microlabs/otel-cf-workers": "1.0.0-rc.45", "@msw/cloudflare": "0.0.1", diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/.gitignore b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/.gitignore similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/.gitignore rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/.gitignore diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/README.md b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/README.md rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/README.md diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/_middleware.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/_middleware.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/_middleware.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/_middleware.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/kv/[key].ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/kv/[key].ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/kv/[key].ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/kv/[key].ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/ping.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/ping.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/api/ping.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/api/ping.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/env.d.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/env.d.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/tsconfig.json b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/functions/tsconfig.json rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/functions/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/global-setup.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/global-setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/global-setup.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/global-setup.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/404.html b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/404.html similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/404.html rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/404.html diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/_headers b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/_headers similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/_headers rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/_headers diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/_redirects b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/_redirects similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/_redirects rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/_redirects diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/index.html b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/index.html similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/index.html rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/index.html diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/secure.html b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/secure.html similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/public/secure.html rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/public/secure.html diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/env.d.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/env.d.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/integration-self.test.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/tsconfig.json b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/tsconfig.json rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/unit.test.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/test/unit.test.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/test/unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/tsconfig.json b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/tsconfig.json rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/vitest.config.ts b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/vitest.config.ts similarity index 94% rename from fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/vitest.config.ts rename to fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/vitest.config.ts index 89818cea6d3..629064702d9 100644 --- a/fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/pages-functions-unit-integration-self/vitest.config.ts @@ -2,7 +2,7 @@ import path from "node:path"; import { buildPagesASSETSBinding, cloudflareTest, -} from "@cloudflare/vitest-pool-workers"; +} from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/pages-with-config/README.md b/fixtures/vitest-plugin-examples/pages-with-config/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-with-config/README.md rename to fixtures/vitest-plugin-examples/pages-with-config/README.md diff --git a/fixtures/vitest-pool-workers-examples/pages-with-config/pages-config.test.ts b/fixtures/vitest-plugin-examples/pages-with-config/pages-config.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-with-config/pages-config.test.ts rename to fixtures/vitest-plugin-examples/pages-with-config/pages-config.test.ts diff --git a/fixtures/vitest-pool-workers-examples/pages-with-config/tsconfig.json b/fixtures/vitest-plugin-examples/pages-with-config/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-with-config/tsconfig.json rename to fixtures/vitest-plugin-examples/pages-with-config/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/vitest.config.ts b/fixtures/vitest-plugin-examples/pages-with-config/vitest.config.ts similarity index 80% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/vitest.config.ts rename to fixtures/vitest-plugin-examples/pages-with-config/vitest.config.ts index d9a889a9fdb..c2326d6f5cb 100644 --- a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/pages-with-config/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/pages-with-config/wrangler.jsonc b/fixtures/vitest-plugin-examples/pages-with-config/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/pages-with-config/wrangler.jsonc rename to fixtures/vitest-plugin-examples/pages-with-config/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/pipelines/README.md b/fixtures/vitest-plugin-examples/pipelines/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/README.md rename to fixtures/vitest-plugin-examples/pipelines/README.md diff --git a/fixtures/vitest-pool-workers-examples/pipelines/src/env.d.ts b/fixtures/vitest-plugin-examples/pipelines/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/src/env.d.ts rename to fixtures/vitest-plugin-examples/pipelines/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/pipelines/src/index.ts b/fixtures/vitest-plugin-examples/pipelines/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/src/index.ts rename to fixtures/vitest-plugin-examples/pipelines/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/pipelines/src/tsconfig.json b/fixtures/vitest-plugin-examples/pipelines/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/src/tsconfig.json rename to fixtures/vitest-plugin-examples/pipelines/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pipelines/test/pipeline-send-integration-self.test.ts b/fixtures/vitest-plugin-examples/pipelines/test/pipeline-send-integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/test/pipeline-send-integration-self.test.ts rename to fixtures/vitest-plugin-examples/pipelines/test/pipeline-send-integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/pipelines/test/pipeline-send-unit.test.ts b/fixtures/vitest-plugin-examples/pipelines/test/pipeline-send-unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/test/pipeline-send-unit.test.ts rename to fixtures/vitest-plugin-examples/pipelines/test/pipeline-send-unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/pipelines/test/tsconfig.json b/fixtures/vitest-plugin-examples/pipelines/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/test/tsconfig.json rename to fixtures/vitest-plugin-examples/pipelines/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pipelines/tsconfig.json b/fixtures/vitest-plugin-examples/pipelines/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/tsconfig.json rename to fixtures/vitest-plugin-examples/pipelines/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/kv-r2-caches/vitest.config.ts b/fixtures/vitest-plugin-examples/pipelines/vitest.config.ts similarity index 81% rename from fixtures/vitest-pool-workers-examples/kv-r2-caches/vitest.config.ts rename to fixtures/vitest-plugin-examples/pipelines/vitest.config.ts index 42170624230..877bda7df9f 100644 --- a/fixtures/vitest-pool-workers-examples/kv-r2-caches/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/pipelines/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/pipelines/wrangler.jsonc b/fixtures/vitest-plugin-examples/pipelines/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/pipelines/wrangler.jsonc rename to fixtures/vitest-plugin-examples/pipelines/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/queues/README.md b/fixtures/vitest-plugin-examples/queues/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/README.md rename to fixtures/vitest-plugin-examples/queues/README.md diff --git a/fixtures/vitest-pool-workers-examples/queues/src/env.d.ts b/fixtures/vitest-plugin-examples/queues/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/src/env.d.ts rename to fixtures/vitest-plugin-examples/queues/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/src/index.ts b/fixtures/vitest-plugin-examples/queues/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/src/index.ts rename to fixtures/vitest-plugin-examples/queues/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/src/tsconfig.json b/fixtures/vitest-plugin-examples/queues/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/src/tsconfig.json rename to fixtures/vitest-plugin-examples/queues/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts b/fixtures/vitest-plugin-examples/queues/test/queue-consumer-integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-integration-self.test.ts rename to fixtures/vitest-plugin-examples/queues/test/queue-consumer-integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-unit.test.ts b/fixtures/vitest-plugin-examples/queues/test/queue-consumer-unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/test/queue-consumer-unit.test.ts rename to fixtures/vitest-plugin-examples/queues/test/queue-consumer-unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-integration-self.test.ts b/fixtures/vitest-plugin-examples/queues/test/queue-producer-integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/test/queue-producer-integration-self.test.ts rename to fixtures/vitest-plugin-examples/queues/test/queue-producer-integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts b/fixtures/vitest-plugin-examples/queues/test/queue-producer-unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/test/queue-producer-unit.test.ts rename to fixtures/vitest-plugin-examples/queues/test/queue-producer-unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/queues/test/tsconfig.json b/fixtures/vitest-plugin-examples/queues/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/test/tsconfig.json rename to fixtures/vitest-plugin-examples/queues/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/queues/tsconfig.json b/fixtures/vitest-plugin-examples/queues/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/tsconfig.json rename to fixtures/vitest-plugin-examples/queues/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/queues/vitest.config.ts b/fixtures/vitest-plugin-examples/queues/vitest.config.ts similarity index 90% rename from fixtures/vitest-pool-workers-examples/queues/vitest.config.ts rename to fixtures/vitest-plugin-examples/queues/vitest.config.ts index fe3a8af95f3..83fd138e38a 100644 --- a/fixtures/vitest-pool-workers-examples/queues/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/queues/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/queues/wrangler.jsonc b/fixtures/vitest-plugin-examples/queues/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/queues/wrangler.jsonc rename to fixtures/vitest-plugin-examples/queues/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/README.md b/fixtures/vitest-plugin-examples/request-mocking/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/README.md rename to fixtures/vitest-plugin-examples/request-mocking/README.md diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/src/env.d.ts b/fixtures/vitest-plugin-examples/request-mocking/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/src/env.d.ts rename to fixtures/vitest-plugin-examples/request-mocking/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/src/index.ts b/fixtures/vitest-plugin-examples/request-mocking/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/src/index.ts rename to fixtures/vitest-plugin-examples/request-mocking/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/src/tsconfig.json b/fixtures/vitest-plugin-examples/request-mocking/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/src/tsconfig.json rename to fixtures/vitest-plugin-examples/request-mocking/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/direct.test.ts b/fixtures/vitest-plugin-examples/request-mocking/test/direct.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/direct.test.ts rename to fixtures/vitest-plugin-examples/request-mocking/test/direct.test.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/exports.test.ts b/fixtures/vitest-plugin-examples/request-mocking/test/exports.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/exports.test.ts rename to fixtures/vitest-plugin-examples/request-mocking/test/exports.test.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/server.ts b/fixtures/vitest-plugin-examples/request-mocking/test/server.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/server.ts rename to fixtures/vitest-plugin-examples/request-mocking/test/server.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/setup.ts b/fixtures/vitest-plugin-examples/request-mocking/test/setup.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/setup.ts rename to fixtures/vitest-plugin-examples/request-mocking/test/setup.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/tsconfig.json b/fixtures/vitest-plugin-examples/request-mocking/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/tsconfig.json rename to fixtures/vitest-plugin-examples/request-mocking/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/test/websocket.test.ts b/fixtures/vitest-plugin-examples/request-mocking/test/websocket.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/test/websocket.test.ts rename to fixtures/vitest-plugin-examples/request-mocking/test/websocket.test.ts diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/tsconfig.json b/fixtures/vitest-plugin-examples/request-mocking/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/tsconfig.json rename to fixtures/vitest-plugin-examples/request-mocking/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/vitest.config.ts b/fixtures/vitest-plugin-examples/request-mocking/vitest.config.ts similarity index 83% rename from fixtures/vitest-pool-workers-examples/request-mocking/vitest.config.ts rename to fixtures/vitest-plugin-examples/request-mocking/vitest.config.ts index 20f7975d5b7..95c61d3070c 100644 --- a/fixtures/vitest-pool-workers-examples/request-mocking/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/request-mocking/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/request-mocking/wrangler.jsonc b/fixtures/vitest-plugin-examples/request-mocking/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/request-mocking/wrangler.jsonc rename to fixtures/vitest-plugin-examples/request-mocking/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/reset/src/env.d.ts b/fixtures/vitest-plugin-examples/reset/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/src/env.d.ts rename to fixtures/vitest-plugin-examples/reset/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/reset/src/index.ts b/fixtures/vitest-plugin-examples/reset/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/src/index.ts rename to fixtures/vitest-plugin-examples/reset/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/reset/src/tsconfig.json b/fixtures/vitest-plugin-examples/reset/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/src/tsconfig.json rename to fixtures/vitest-plugin-examples/reset/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/reset/test/reset.test.ts b/fixtures/vitest-plugin-examples/reset/test/reset.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/test/reset.test.ts rename to fixtures/vitest-plugin-examples/reset/test/reset.test.ts diff --git a/fixtures/vitest-pool-workers-examples/reset/test/tsconfig.json b/fixtures/vitest-plugin-examples/reset/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/test/tsconfig.json rename to fixtures/vitest-plugin-examples/reset/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/reset/tsconfig.json b/fixtures/vitest-plugin-examples/reset/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/tsconfig.json rename to fixtures/vitest-plugin-examples/reset/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/reset/vitest.config.ts b/fixtures/vitest-plugin-examples/reset/vitest.config.ts similarity index 83% rename from fixtures/vitest-pool-workers-examples/reset/vitest.config.ts rename to fixtures/vitest-plugin-examples/reset/vitest.config.ts index 2590f0b2759..7d100144fd6 100644 --- a/fixtures/vitest-pool-workers-examples/reset/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/reset/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/reset/wrangler.jsonc b/fixtures/vitest-plugin-examples/reset/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/reset/wrangler.jsonc rename to fixtures/vitest-plugin-examples/reset/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/rpc/README.md b/fixtures/vitest-plugin-examples/rpc/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/README.md rename to fixtures/vitest-plugin-examples/rpc/README.md diff --git a/fixtures/vitest-pool-workers-examples/rpc/src/counter.ts b/fixtures/vitest-plugin-examples/rpc/src/counter.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/src/counter.ts rename to fixtures/vitest-plugin-examples/rpc/src/counter.ts diff --git a/fixtures/vitest-pool-workers-examples/rpc/src/env.d.ts b/fixtures/vitest-plugin-examples/rpc/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/src/env.d.ts rename to fixtures/vitest-plugin-examples/rpc/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/rpc/src/index.ts b/fixtures/vitest-plugin-examples/rpc/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/src/index.ts rename to fixtures/vitest-plugin-examples/rpc/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/rpc/src/tsconfig.json b/fixtures/vitest-plugin-examples/rpc/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/src/tsconfig.json rename to fixtures/vitest-plugin-examples/rpc/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/rpc/test/integration-self.test.ts b/fixtures/vitest-plugin-examples/rpc/test/integration-self.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/test/integration-self.test.ts rename to fixtures/vitest-plugin-examples/rpc/test/integration-self.test.ts diff --git a/fixtures/vitest-pool-workers-examples/rpc/test/tsconfig.json b/fixtures/vitest-plugin-examples/rpc/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/test/tsconfig.json rename to fixtures/vitest-plugin-examples/rpc/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/rpc/test/unit.test.ts b/fixtures/vitest-plugin-examples/rpc/test/unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/test/unit.test.ts rename to fixtures/vitest-plugin-examples/rpc/test/unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/rpc/tsconfig.json b/fixtures/vitest-plugin-examples/rpc/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/tsconfig.json rename to fixtures/vitest-plugin-examples/rpc/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/rpc/vitest.config.ts b/fixtures/vitest-plugin-examples/rpc/vitest.config.ts similarity index 89% rename from fixtures/vitest-pool-workers-examples/rpc/vitest.config.ts rename to fixtures/vitest-plugin-examples/rpc/vitest.config.ts index 515584f0082..48bd98584d7 100644 --- a/fixtures/vitest-pool-workers-examples/rpc/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/rpc/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/rpc/wrangler.jsonc b/fixtures/vitest-plugin-examples/rpc/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/rpc/wrangler.jsonc rename to fixtures/vitest-plugin-examples/rpc/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/tsc-all.mjs b/fixtures/vitest-plugin-examples/tsc-all.mjs similarity index 100% rename from fixtures/vitest-pool-workers-examples/tsc-all.mjs rename to fixtures/vitest-plugin-examples/tsc-all.mjs diff --git a/fixtures/vitest-pool-workers-examples/tsconfig.node.json b/fixtures/vitest-plugin-examples/tsconfig.node.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/tsconfig.node.json rename to fixtures/vitest-plugin-examples/tsconfig.node.json diff --git a/fixtures/vitest-pool-workers-examples/tsconfig.workerd-test.json b/fixtures/vitest-plugin-examples/tsconfig.workerd-test.json similarity index 85% rename from fixtures/vitest-pool-workers-examples/tsconfig.workerd-test.json rename to fixtures/vitest-plugin-examples/tsconfig.workerd-test.json index 3aa2158e58a..13336455e0b 100644 --- a/fixtures/vitest-pool-workers-examples/tsconfig.workerd-test.json +++ b/fixtures/vitest-plugin-examples/tsconfig.workerd-test.json @@ -3,7 +3,7 @@ "compilerOptions": { "types": [ "@cloudflare/workers-types/experimental", - "@cloudflare/vitest-pool-workers/types", + "@cloudflare/vitest-plugin/types", "@types/node", // For tests using Node.js compat APIs (process, Buffer, node:*) "vite/client" // For `?raw`, `?url`, etc. import types ] diff --git a/fixtures/vitest-pool-workers-examples/tsconfig.workerd.json b/fixtures/vitest-plugin-examples/tsconfig.workerd.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/tsconfig.workerd.json rename to fixtures/vitest-plugin-examples/tsconfig.workerd.json diff --git a/fixtures/vitest-pool-workers-examples/vitest.config.ts b/fixtures/vitest-plugin-examples/vitest.config.ts similarity index 92% rename from fixtures/vitest-pool-workers-examples/vitest.config.ts rename to fixtures/vitest-plugin-examples/vitest.config.ts index b292e263050..0093676f1d2 100644 --- a/fixtures/vitest-pool-workers-examples/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/vitest.config.ts @@ -1,4 +1,4 @@ -// Root vitest config for the vitest-pool-workers-examples fixture. +// Root vitest config for the vitest-plugin-examples fixture. // Per the Vitest 4 docs, only `globalSetup`, `reporters`, `coverage`, and // other "global" options are inherited from this root config; project test // options (testTimeout, retry, etc.) are NOT inherited. Each project under diff --git a/fixtures/vitest-pool-workers-examples/vitest.global.ts b/fixtures/vitest-plugin-examples/vitest.global.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/vitest.global.ts rename to fixtures/vitest-plugin-examples/vitest.global.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/README.md b/fixtures/vitest-plugin-examples/web-assembly/README.md similarity index 71% rename from fixtures/vitest-pool-workers-examples/web-assembly/README.md rename to fixtures/vitest-plugin-examples/web-assembly/README.md index c1018163bdb..98c043175ba 100644 --- a/fixtures/vitest-pool-workers-examples/web-assembly/README.md +++ b/fixtures/vitest-plugin-examples/web-assembly/README.md @@ -1,6 +1,6 @@ # ⚙️ web-assembly -This Worker makes use of a WebAssembly module to add two numbers together. Wrangler's default module rules are enabled by `@cloudflare/vitest-pool-workers` if you have a `wrangler.configPath` configured. This means `.wasm` files can be imported as `WebAssembly.Module`s. +This Worker makes use of a WebAssembly module to add two numbers together. Wrangler's default module rules are enabled by `@cloudflare/vitest-plugin` if you have a `wrangler.configPath` configured. This means `.wasm` files can be imported as `WebAssembly.Module`s. | Test | Overview | | ------------------------------- | -------------------------------- | diff --git a/fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/add.wasm b/fixtures/vitest-plugin-examples/web-assembly/src/add.wasm similarity index 100% rename from fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep/add.wasm rename to fixtures/vitest-plugin-examples/web-assembly/src/add.wasm diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/src/env.d.ts b/fixtures/vitest-plugin-examples/web-assembly/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/src/env.d.ts rename to fixtures/vitest-plugin-examples/web-assembly/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/src/index.ts b/fixtures/vitest-plugin-examples/web-assembly/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/src/index.ts rename to fixtures/vitest-plugin-examples/web-assembly/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/src/tsconfig.json b/fixtures/vitest-plugin-examples/web-assembly/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/src/tsconfig.json rename to fixtures/vitest-plugin-examples/web-assembly/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/src/wasm-shim.d.ts b/fixtures/vitest-plugin-examples/web-assembly/src/wasm-shim.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/src/wasm-shim.d.ts rename to fixtures/vitest-plugin-examples/web-assembly/src/wasm-shim.d.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/test/add.test.ts b/fixtures/vitest-plugin-examples/web-assembly/test/add.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/test/add.test.ts rename to fixtures/vitest-plugin-examples/web-assembly/test/add.test.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/test/not-actually.wasm.test.ts b/fixtures/vitest-plugin-examples/web-assembly/test/not-actually.wasm.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/test/not-actually.wasm.test.ts rename to fixtures/vitest-plugin-examples/web-assembly/test/not-actually.wasm.test.ts diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/test/tsconfig.json b/fixtures/vitest-plugin-examples/web-assembly/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/test/tsconfig.json rename to fixtures/vitest-plugin-examples/web-assembly/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/tsconfig.json b/fixtures/vitest-plugin-examples/web-assembly/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/tsconfig.json rename to fixtures/vitest-plugin-examples/web-assembly/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/vitest.config.ts b/fixtures/vitest-plugin-examples/web-assembly/vitest.config.ts similarity index 89% rename from fixtures/vitest-pool-workers-examples/web-assembly/vitest.config.ts rename to fixtures/vitest-plugin-examples/web-assembly/vitest.config.ts index f8b2e2bd822..23079f3f348 100644 --- a/fixtures/vitest-pool-workers-examples/web-assembly/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/web-assembly/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/web-assembly/wrangler.jsonc b/fixtures/vitest-plugin-examples/web-assembly/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/web-assembly/wrangler.jsonc rename to fixtures/vitest-plugin-examples/web-assembly/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/env.d.ts b/fixtures/vitest-plugin-examples/workers-assets-no-dir/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/env.d.ts rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/index.ts b/fixtures/vitest-plugin-examples/workers-assets-no-dir/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/index.ts rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets-no-dir/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/src/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/test/assets-no-dir.test.ts b/fixtures/vitest-plugin-examples/workers-assets-no-dir/test/assets-no-dir.test.ts similarity index 91% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/test/assets-no-dir.test.ts rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/test/assets-no-dir.test.ts index 9e1ab2cfa7b..53f1ae2dd62 100644 --- a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/test/assets-no-dir.test.ts +++ b/fixtures/vitest-plugin-examples/workers-assets-no-dir/test/assets-no-dir.test.ts @@ -5,7 +5,7 @@ import { describe, it } from "vitest"; // // When a wrangler config has `assets: { binding: "ASSETS" }` but no `directory` // (as is common when using @cloudflare/vite-plugin, which handles asset serving -// independently via its dev server), vitest-pool-workers must not throw: +// independently via its dev server), vitest-plugin must not throw: // "The `assets` property in your configuration is missing the required `directory` property." describe("workers-assets-no-dir", () => { diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/test/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets-no-dir/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/test/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets-no-dir/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/pages-with-config/vitest.config.ts b/fixtures/vitest-plugin-examples/workers-assets-no-dir/vitest.config.ts similarity index 80% rename from fixtures/vitest-pool-workers-examples/pages-with-config/vitest.config.ts rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/vitest.config.ts index d9a889a9fdb..c2326d6f5cb 100644 --- a/fixtures/vitest-pool-workers-examples/pages-with-config/vitest.config.ts +++ b/fixtures/vitest-plugin-examples/workers-assets-no-dir/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineProject, mergeConfig } from "vitest/config"; import configShared from "../../../vitest.shared"; diff --git a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/wrangler.jsonc b/fixtures/vitest-plugin-examples/workers-assets-no-dir/wrangler.jsonc similarity index 76% rename from fixtures/vitest-pool-workers-examples/workers-assets-no-dir/wrangler.jsonc rename to fixtures/vitest-plugin-examples/workers-assets-no-dir/wrangler.jsonc index 49d877d6b12..af024f71f90 100644 --- a/fixtures/vitest-pool-workers-examples/workers-assets-no-dir/wrangler.jsonc +++ b/fixtures/vitest-plugin-examples/workers-assets-no-dir/wrangler.jsonc @@ -3,7 +3,7 @@ "main": "src/index.ts", // Simulate a project using @cloudflare/vite-plugin where assets are configured // with a binding but no directory (vite-plugin serves them via its dev server). - // vitest-pool-workers must not throw "missing required `directory` property" here. + // vitest-plugin must not throw "missing required `directory` property" here. "assets": { "binding": "ASSETS", }, diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/README.md b/fixtures/vitest-plugin-examples/workers-assets/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/README.md rename to fixtures/vitest-plugin-examples/workers-assets/README.md diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/public/binding.html b/fixtures/vitest-plugin-examples/workers-assets/public/binding.html similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/public/binding.html rename to fixtures/vitest-plugin-examples/workers-assets/public/binding.html diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/public/index.html b/fixtures/vitest-plugin-examples/workers-assets/public/index.html similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/public/index.html rename to fixtures/vitest-plugin-examples/workers-assets/public/index.html diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/src/env.d.ts b/fixtures/vitest-plugin-examples/workers-assets/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/src/env.d.ts rename to fixtures/vitest-plugin-examples/workers-assets/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/src/index.ts b/fixtures/vitest-plugin-examples/workers-assets/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/src/index.ts rename to fixtures/vitest-plugin-examples/workers-assets/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/src/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/src/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/test/assets.test.ts b/fixtures/vitest-plugin-examples/workers-assets/test/assets.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/test/assets.test.ts rename to fixtures/vitest-plugin-examples/workers-assets/test/assets.test.ts diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/test/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/test/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/tsconfig.json b/fixtures/vitest-plugin-examples/workers-assets/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/tsconfig.json rename to fixtures/vitest-plugin-examples/workers-assets/tsconfig.json diff --git a/fixtures/vitest-plugin-examples/workers-assets/vitest.config.ts b/fixtures/vitest-plugin-examples/workers-assets/vitest.config.ts new file mode 100644 index 00000000000..c2326d6f5cb --- /dev/null +++ b/fixtures/vitest-plugin-examples/workers-assets/vitest.config.ts @@ -0,0 +1,14 @@ +import { cloudflareTest } from "@cloudflare/vitest-plugin"; +import { defineProject, mergeConfig } from "vitest/config"; +import configShared from "../../../vitest.shared"; + +export default mergeConfig( + configShared, + defineProject({ + plugins: [ + cloudflareTest({ + wrangler: { configPath: "./wrangler.jsonc" }, + }), + ], + }) +); diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/wrangler.jsonc b/fixtures/vitest-plugin-examples/workers-assets/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/workers-assets/wrangler.jsonc rename to fixtures/vitest-plugin-examples/workers-assets/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-examples/workflows/README.md b/fixtures/vitest-plugin-examples/workflows/README.md similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/README.md rename to fixtures/vitest-plugin-examples/workflows/README.md diff --git a/fixtures/vitest-pool-workers-examples/workflows/src/env.d.ts b/fixtures/vitest-plugin-examples/workflows/src/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/src/env.d.ts rename to fixtures/vitest-plugin-examples/workflows/src/env.d.ts diff --git a/fixtures/vitest-pool-workers-examples/workflows/src/index.ts b/fixtures/vitest-plugin-examples/workflows/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/src/index.ts rename to fixtures/vitest-plugin-examples/workflows/src/index.ts diff --git a/fixtures/vitest-pool-workers-examples/workflows/src/tsconfig.json b/fixtures/vitest-plugin-examples/workflows/src/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/src/tsconfig.json rename to fixtures/vitest-plugin-examples/workflows/src/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workflows/test/integration.test.ts b/fixtures/vitest-plugin-examples/workflows/test/integration.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/test/integration.test.ts rename to fixtures/vitest-plugin-examples/workflows/test/integration.test.ts diff --git a/fixtures/vitest-pool-workers-examples/workflows/test/tsconfig.json b/fixtures/vitest-plugin-examples/workflows/test/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/test/tsconfig.json rename to fixtures/vitest-plugin-examples/workflows/test/tsconfig.json diff --git a/fixtures/vitest-pool-workers-examples/workflows/test/unit.test.ts b/fixtures/vitest-plugin-examples/workflows/test/unit.test.ts similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/test/unit.test.ts rename to fixtures/vitest-plugin-examples/workflows/test/unit.test.ts diff --git a/fixtures/vitest-pool-workers-examples/workflows/tsconfig.json b/fixtures/vitest-plugin-examples/workflows/tsconfig.json similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/tsconfig.json rename to fixtures/vitest-plugin-examples/workflows/tsconfig.json diff --git a/fixtures/vitest-plugin-examples/workflows/vitest.config.ts b/fixtures/vitest-plugin-examples/workflows/vitest.config.ts new file mode 100644 index 00000000000..877bda7df9f --- /dev/null +++ b/fixtures/vitest-plugin-examples/workflows/vitest.config.ts @@ -0,0 +1,16 @@ +import { cloudflareTest } from "@cloudflare/vitest-plugin"; +import { defineProject, mergeConfig } from "vitest/config"; +import configShared from "../../../vitest.shared"; + +export default mergeConfig( + configShared, + defineProject({ + plugins: [ + cloudflareTest({ + wrangler: { + configPath: "./wrangler.jsonc", + }, + }), + ], + }) +); diff --git a/fixtures/vitest-pool-workers-examples/workflows/wrangler.jsonc b/fixtures/vitest-plugin-examples/workflows/wrangler.jsonc similarity index 100% rename from fixtures/vitest-pool-workers-examples/workflows/wrangler.jsonc rename to fixtures/vitest-plugin-examples/workflows/wrangler.jsonc diff --git a/fixtures/vitest-pool-workers-remote-bindings/env.d.ts b/fixtures/vitest-plugin-remote-bindings/env.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-remote-bindings/env.d.ts rename to fixtures/vitest-plugin-remote-bindings/env.d.ts diff --git a/fixtures/vitest-pool-workers-remote-bindings/package.json b/fixtures/vitest-plugin-remote-bindings/package.json similarity index 76% rename from fixtures/vitest-pool-workers-remote-bindings/package.json rename to fixtures/vitest-plugin-remote-bindings/package.json index 72ac0b9cba3..605148b13b6 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/package.json +++ b/fixtures/vitest-plugin-remote-bindings/package.json @@ -1,5 +1,5 @@ { - "name": "@fixture/vitest-pool-workers-remote-bindings", + "name": "@fixture/vitest-plugin-remote-bindings", "private": true, "type": "module", "scripts": { @@ -9,7 +9,7 @@ "test:vitest": "vitest run" }, "devDependencies": { - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "typescript": "catalog:default", "vitest": "catalog:default", "wrangler": "workspace:*" diff --git a/fixtures/vitest-plugin-remote-bindings/remote-worker.js b/fixtures/vitest-plugin-remote-bindings/remote-worker.js new file mode 100644 index 00000000000..12ebaed2128 --- /dev/null +++ b/fixtures/vitest-plugin-remote-bindings/remote-worker.js @@ -0,0 +1,7 @@ +export default { + fetch() { + return new Response( + "Hello from a remote Worker part of the vitest-plugin remote bindings fixture!" + ); + }, +}; diff --git a/fixtures/vitest-pool-workers-remote-bindings/remote-worker.staging.js b/fixtures/vitest-plugin-remote-bindings/remote-worker.staging.js similarity index 66% rename from fixtures/vitest-pool-workers-remote-bindings/remote-worker.staging.js rename to fixtures/vitest-plugin-remote-bindings/remote-worker.staging.js index 2857097be87..7fe0d438ad6 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/remote-worker.staging.js +++ b/fixtures/vitest-plugin-remote-bindings/remote-worker.staging.js @@ -1,7 +1,7 @@ export default { fetch() { return new Response( - "Hello from a remote Worker, defined for the staging environment, part of the vitest-pool-workers remote bindings fixture!" + "Hello from a remote Worker, defined for the staging environment, part of the vitest-plugin remote bindings fixture!" ); }, }; diff --git a/fixtures/vitest-pool-workers-remote-bindings/run-tests.mjs b/fixtures/vitest-plugin-remote-bindings/run-tests.mjs similarity index 94% rename from fixtures/vitest-pool-workers-remote-bindings/run-tests.mjs rename to fixtures/vitest-plugin-remote-bindings/run-tests.mjs index 72c90aae4ab..cbf1b5114c8 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/run-tests.mjs +++ b/fixtures/vitest-plugin-remote-bindings/run-tests.mjs @@ -131,14 +131,12 @@ await Promise.all([ try { try { try { - console.log("Running vitest-pool-workers remote bindings tests..."); + console.log("Running vitest-plugin remote bindings tests..."); execSync("pnpm test:vitest --config ./.tmp/vitest.workers.config.ts", { env, stdio: "inherit", }); - console.log( - "Running vitest-pool-workers remote bindings staging tests..." - ); + console.log("Running vitest-plugin remote bindings staging tests..."); execSync( "pnpm test:vitest --config ./.tmp/vitest.workers.config.staging.ts", { @@ -176,7 +174,7 @@ function getAuthenticatedEnv() { }; } console.warn( - "Skipping vitest-pool-workers remote bindings tests because the environment is not authenticated with Cloudflare." + "Skipping vitest-plugin remote bindings tests because the environment is not authenticated with Cloudflare." ); } diff --git a/fixtures/vitest-pool-workers-remote-bindings/src/index.ts b/fixtures/vitest-plugin-remote-bindings/src/index.ts similarity index 100% rename from fixtures/vitest-pool-workers-remote-bindings/src/index.ts rename to fixtures/vitest-plugin-remote-bindings/src/index.ts diff --git a/fixtures/vitest-pool-workers-remote-bindings/test-staging/index.spec.ts b/fixtures/vitest-plugin-remote-bindings/test-staging/index.spec.ts similarity index 85% rename from fixtures/vitest-pool-workers-remote-bindings/test-staging/index.spec.ts rename to fixtures/vitest-plugin-remote-bindings/test-staging/index.spec.ts index 5af2c128638..fab84eadf16 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/test-staging/index.spec.ts +++ b/fixtures/vitest-plugin-remote-bindings/test-staging/index.spec.ts @@ -14,7 +14,7 @@ describe("Vitest pool workers remote bindings with a staging environment", () => const ctx = createExecutionContext(); await waitOnExecutionContext(ctx); expect(await response.text()).toMatchInlineSnapshot( - `"Hello from a remote Worker, defined for the staging environment, part of the vitest-pool-workers remote bindings fixture!"` + `"Hello from a remote Worker, defined for the staging environment, part of the vitest-plugin remote bindings fixture!"` ); } ); @@ -24,7 +24,7 @@ describe("Vitest pool workers remote bindings with a staging environment", () => }) => { const response = await exports.default.fetch("https://example.com"); expect(await response.text()).toMatchInlineSnapshot( - `"Response from remote worker: Hello from a remote Worker, defined for the staging environment, part of the vitest-pool-workers remote bindings fixture!"` + `"Response from remote worker: Hello from a remote Worker, defined for the staging environment, part of the vitest-plugin remote bindings fixture!"` ); }); }); diff --git a/fixtures/vitest-pool-workers-remote-bindings/test/index.spec.ts b/fixtures/vitest-plugin-remote-bindings/test/index.spec.ts similarity index 85% rename from fixtures/vitest-pool-workers-remote-bindings/test/index.spec.ts rename to fixtures/vitest-plugin-remote-bindings/test/index.spec.ts index 7e3206d549b..d2780c0ada3 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/test/index.spec.ts +++ b/fixtures/vitest-plugin-remote-bindings/test/index.spec.ts @@ -14,7 +14,7 @@ describe("Vitest pool workers remote bindings", () => { const ctx = createExecutionContext(); await waitOnExecutionContext(ctx); expect(await response.text()).toMatchInlineSnapshot( - `"Hello from a remote Worker part of the vitest-pool-workers remote bindings fixture!"` + `"Hello from a remote Worker part of the vitest-plugin remote bindings fixture!"` ); } ); @@ -24,7 +24,7 @@ describe("Vitest pool workers remote bindings", () => { }) => { const response = await exports.default.fetch("https://example.com"); expect(await response.text()).toMatchInlineSnapshot( - `"Response from remote worker: Hello from a remote Worker part of the vitest-pool-workers remote bindings fixture!"` + `"Response from remote worker: Hello from a remote Worker part of the vitest-plugin remote bindings fixture!"` ); }); }); diff --git a/fixtures/vitest-pool-workers-remote-bindings/tsconfig.json b/fixtures/vitest-plugin-remote-bindings/tsconfig.json similarity index 76% rename from fixtures/vitest-pool-workers-remote-bindings/tsconfig.json rename to fixtures/vitest-plugin-remote-bindings/tsconfig.json index 67d85734ba9..2c4a6d8e881 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/tsconfig.json +++ b/fixtures/vitest-plugin-remote-bindings/tsconfig.json @@ -4,10 +4,7 @@ "lib": ["esnext"], "module": "esnext", "moduleResolution": "bundler", - "types": [ - "./worker-configuration.d.ts", - "@cloudflare/vitest-pool-workers/types" - ], + "types": ["./worker-configuration.d.ts", "@cloudflare/vitest-plugin/types"], "noEmit": true, "isolatedModules": true, "forceConsistentCasingInFileNames": true, diff --git a/fixtures/vitest-pool-workers-remote-bindings/turbo.json b/fixtures/vitest-plugin-remote-bindings/turbo.json similarity index 100% rename from fixtures/vitest-pool-workers-remote-bindings/turbo.json rename to fixtures/vitest-plugin-remote-bindings/turbo.json diff --git a/fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.staging.ts b/fixtures/vitest-plugin-remote-bindings/vitest.workers.config.staging.ts similarity index 65% rename from fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.staging.ts rename to fixtures/vitest-plugin-remote-bindings/vitest.workers.config.staging.ts index 8a8c9e6c410..7bb8bff9e2d 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.staging.ts +++ b/fixtures/vitest-plugin-remote-bindings/vitest.workers.config.staging.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ @@ -12,10 +12,7 @@ export default defineConfig({ include: ["test-staging/**/*.spec.ts"], server: { deps: { - external: [ - /packages\/vitest-pool-workers\/dist/, - /packages\/wrangler\//, - ], + external: [/packages\/vitest-plugin\/dist/, /packages\/wrangler\//], }, }, }, diff --git a/fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.ts b/fixtures/vitest-plugin-remote-bindings/vitest.workers.config.ts similarity index 63% rename from fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.ts rename to fixtures/vitest-plugin-remote-bindings/vitest.workers.config.ts index 38e9fcdd697..a0fa7af27a4 100644 --- a/fixtures/vitest-pool-workers-remote-bindings/vitest.workers.config.ts +++ b/fixtures/vitest-plugin-remote-bindings/vitest.workers.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ @@ -12,10 +12,7 @@ export default defineConfig({ include: ["test/**/*.spec.ts"], server: { deps: { - external: [ - /packages\/vitest-pool-workers\/dist/, - /packages\/wrangler\//, - ], + external: [/packages\/vitest-plugin\/dist/, /packages\/wrangler\//], }, }, }, diff --git a/fixtures/vitest-pool-workers-remote-bindings/worker-configuration.d.ts b/fixtures/vitest-plugin-remote-bindings/worker-configuration.d.ts similarity index 100% rename from fixtures/vitest-pool-workers-remote-bindings/worker-configuration.d.ts rename to fixtures/vitest-plugin-remote-bindings/worker-configuration.d.ts diff --git a/fixtures/vitest-pool-workers-remote-bindings/wrangler.json b/fixtures/vitest-plugin-remote-bindings/wrangler.json similarity index 100% rename from fixtures/vitest-pool-workers-remote-bindings/wrangler.json rename to fixtures/vitest-plugin-remote-bindings/wrangler.json diff --git a/fixtures/vitest-pool-workers-examples/container-app/README.md b/fixtures/vitest-pool-workers-examples/container-app/README.md deleted file mode 100644 index f0ad4a9b69d..00000000000 --- a/fixtures/vitest-pool-workers-examples/container-app/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Apps with no-op containers - -Currently, `vitest-pool-workers` does not support testing containers yet. It should still let you test your application as long as you do not test with any code paths that interact with containers. diff --git a/fixtures/vitest-pool-workers-examples/misc/README.md b/fixtures/vitest-pool-workers-examples/misc/README.md deleted file mode 100644 index 24cbb33ada8..00000000000 --- a/fixtures/vitest-pool-workers-examples/misc/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# 🤷 misc - -We run all the tests in `vitest-pool-workers-examples` on every change to `workers-sdk`. This directory contains a bunch of tests to validate assorted Vitest features that aren't tested elsewhere. diff --git a/fixtures/vitest-pool-workers-examples/workers-assets/vitest.config.ts b/fixtures/vitest-pool-workers-examples/workers-assets/vitest.config.ts deleted file mode 100644 index d9a889a9fdb..00000000000 --- a/fixtures/vitest-pool-workers-examples/workers-assets/vitest.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; -import { defineProject, mergeConfig } from "vitest/config"; -import configShared from "../../../vitest.shared"; - -export default mergeConfig( - configShared, - defineProject({ - plugins: [ - cloudflareTest({ - wrangler: { configPath: "./wrangler.jsonc" }, - }), - ], - }) -); diff --git a/fixtures/vitest-pool-workers-examples/workflows/vitest.config.ts b/fixtures/vitest-pool-workers-examples/workflows/vitest.config.ts deleted file mode 100644 index 42170624230..00000000000 --- a/fixtures/vitest-pool-workers-examples/workflows/vitest.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; -import { defineProject, mergeConfig } from "vitest/config"; -import configShared from "../../../vitest.shared"; - -export default mergeConfig( - configShared, - defineProject({ - plugins: [ - cloudflareTest({ - wrangler: { - configPath: "./wrangler.jsonc", - }, - }), - ], - }) -); diff --git a/fixtures/vitest-pool-workers-remote-bindings/remote-worker.js b/fixtures/vitest-pool-workers-remote-bindings/remote-worker.js deleted file mode 100644 index 3e6f023a8df..00000000000 --- a/fixtures/vitest-pool-workers-remote-bindings/remote-worker.js +++ /dev/null @@ -1,7 +0,0 @@ -export default { - fetch() { - return new Response( - "Hello from a remote Worker part of the vitest-pool-workers remote bindings fixture!" - ); - }, -}; diff --git a/fixtures/worker-with-unsafe-external-plugin/package.json b/fixtures/worker-with-unsafe-external-plugin/package.json index beb7887b055..4cee3c20cf1 100644 --- a/fixtures/worker-with-unsafe-external-plugin/package.json +++ b/fixtures/worker-with-unsafe-external-plugin/package.json @@ -8,7 +8,7 @@ "test:watch": "vitest" }, "devDependencies": { - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "@cloudflare/workers-tsconfig": "workspace:*", "@fixture/unsafe-external-plugin": "workspace:*", "turbo": "^2.2.3", diff --git a/fixtures/worker-with-unsafe-external-plugin/tests/tsconfig.json b/fixtures/worker-with-unsafe-external-plugin/tests/tsconfig.json index deb64120306..e0aba42c7d3 100644 --- a/fixtures/worker-with-unsafe-external-plugin/tests/tsconfig.json +++ b/fixtures/worker-with-unsafe-external-plugin/tests/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "types": [ "@cloudflare/workers-types/experimental", - "@cloudflare/vitest-pool-workers/types" + "@cloudflare/vitest-plugin/types" ] }, "include": ["./**/*.ts", "../src/env.d.ts"] diff --git a/fixtures/worker-with-unsafe-external-plugin/vitest.config.ts b/fixtures/worker-with-unsafe-external-plugin/vitest.config.ts index 4ece1a12b57..610e4db83d4 100644 --- a/fixtures/worker-with-unsafe-external-plugin/vitest.config.ts +++ b/fixtures/worker-with-unsafe-external-plugin/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ diff --git a/fixtures/workers-shared-asset-config/package.json b/fixtures/workers-shared-asset-config/package.json index 13e671a77d7..3deed5baba2 100644 --- a/fixtures/workers-shared-asset-config/package.json +++ b/fixtures/workers-shared-asset-config/package.json @@ -11,7 +11,7 @@ "type:tests": "tsc -p ./tsconfig.json" }, "devDependencies": { - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "@cloudflare/workers-shared": "workspace:*", "@cloudflare/workers-tsconfig": "workspace:*", "@cloudflare/workers-types": "catalog:default", diff --git a/fixtures/workers-shared-asset-config/tsconfig.json b/fixtures/workers-shared-asset-config/tsconfig.json index b562c4033bf..9453f5bdc7e 100644 --- a/fixtures/workers-shared-asset-config/tsconfig.json +++ b/fixtures/workers-shared-asset-config/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "types": [ "@cloudflare/workers-types/experimental", - "@cloudflare/vitest-pool-workers/types" + "@cloudflare/vitest-plugin/types" ], "moduleResolution": "bundler" }, diff --git a/fixtures/workers-shared-asset-config/vitest.config.ts b/fixtures/workers-shared-asset-config/vitest.config.ts index d78558198c6..5d96cbcdfe3 100644 --- a/fixtures/workers-shared-asset-config/vitest.config.ts +++ b/fixtures/workers-shared-asset-config/vitest.config.ts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ diff --git a/packages/edge-preview-authenticated-proxy/package.json b/packages/edge-preview-authenticated-proxy/package.json index e18cbb413a5..f24d6f9ec5f 100644 --- a/packages/edge-preview-authenticated-proxy/package.json +++ b/packages/edge-preview-authenticated-proxy/package.json @@ -10,7 +10,7 @@ "type:tests": "tsc -p ./tests/tsconfig.json" }, "devDependencies": { - "@cloudflare/vitest-pool-workers": "workspace:*", + "@cloudflare/vitest-plugin": "workspace:*", "@cloudflare/workers-types": "catalog:default", "@cloudflare/workers-utils": "workspace:*", "@types/cookie": "^0.6.0", diff --git a/packages/edge-preview-authenticated-proxy/tests/tsconfig.json b/packages/edge-preview-authenticated-proxy/tests/tsconfig.json index 73752a87648..053d074e369 100644 --- a/packages/edge-preview-authenticated-proxy/tests/tsconfig.json +++ b/packages/edge-preview-authenticated-proxy/tests/tsconfig.json @@ -7,7 +7,7 @@ "types": [ "@types/node", "@cloudflare/workers-types/experimental", - "@cloudflare/vitest-pool-workers/types" + "@cloudflare/vitest-plugin/types" ], "allowJs": true, "checkJs": false, diff --git a/packages/edge-preview-authenticated-proxy/vitest.config.mts b/packages/edge-preview-authenticated-proxy/vitest.config.mts index e8bcc200641..a00c094e1fe 100644 --- a/packages/edge-preview-authenticated-proxy/vitest.config.mts +++ b/packages/edge-preview-authenticated-proxy/vitest.config.mts @@ -1,4 +1,4 @@ -import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; +import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig({ diff --git a/packages/miniflare/src/index.ts b/packages/miniflare/src/index.ts index 7a6c2f4b98b..4dde0e6aa75 100644 --- a/packages/miniflare/src/index.ts +++ b/packages/miniflare/src/index.ts @@ -2308,9 +2308,7 @@ export class Miniflare { */ fallbackWorkerName: this.#workerOpts[0].assets.assets && - !this.#workerOpts[0].core.name?.startsWith( - "vitest-pool-workers-runner-" - ) + !this.#workerOpts[0].core.name?.startsWith("vitest-plugin-runner-") ? `${RPC_PROXY_SERVICE_NAME}:${this.#workerOpts[0].core.name}` : getUserServiceName(this.#workerOpts[0].core.name), tmpPath: this.#tmpPath, diff --git a/packages/mock-npm-registry/README.md b/packages/mock-npm-registry/README.md index f894824341c..57f476ac20a 100644 --- a/packages/mock-npm-registry/README.md +++ b/packages/mock-npm-registry/README.md @@ -4,11 +4,11 @@ This internal package can be used in tests by othe packages to set up a mock loc ## Usage -A good example is the vitest-pool-workers e2e tests. See packages/vitest-pool-workers/test/global-setup.ts +A good example is the vitest-plugin e2e tests. See packages/vitest-plugin/test/global-setup.ts ```ts export default async function ({ provide }: GlobalSetupContext) { - const stop = await startMockNpmRegistry("@cloudflare/vitest-pool-workers"); + const stop = await startMockNpmRegistry("@cloudflare/vitest-plugin"); // Create temporary directory const projectPath = await createTestProject(); @@ -18,10 +18,10 @@ export default async function ({ provide }: GlobalSetupContext) { ``` Here you can see that in Vitest global setup file, we are calling `startMockNpmRegistry()`. -We pass in the `@cloudflare/vitest-pool-workers` package name, which will ensure that this package +We pass in the `@cloudflare/vitest-plugin` package name, which will ensure that this package (and all its local dependencies, such as Wrangler, Miniflare, etc) is built and published to the mock registry. -We then create a temporary test project that has a dependency on `@cloudflare/vitest-pool-workers` +We then create a temporary test project that has a dependency on `@cloudflare/vitest-plugin` and then run `pnpm install`, which will install the locally published packages. The path to this temporary test project is provided to tests. diff --git a/packages/vitest-pool-workers/AGENTS.md b/packages/vitest-plugin/AGENTS.md similarity index 87% rename from packages/vitest-pool-workers/AGENTS.md rename to packages/vitest-plugin/AGENTS.md index 7cc0903c479..f861dad830a 100644 --- a/packages/vitest-pool-workers/AGENTS.md +++ b/packages/vitest-plugin/AGENTS.md @@ -1,4 +1,4 @@ -# vitest-pool-workers — Agent Guide +# vitest-plugin — Agent Guide > Custom Vitest pool for running Worker tests inside the actual workerd runtime. > Do NOT repeat root AGENTS.md content (pnpm, changesets, code style, etc.). @@ -43,7 +43,7 @@ Tests inside workerd import from `cloudflare:test`: import { env, fetchMock, SELF } from "cloudflare:test"; ``` -Resolved by custom Vite plugin (`@cloudflare/vitest-pool-workers:config`) that re-exports from `cloudflare:test-internal` (runtime-provided). +Resolved by custom Vite plugin (`@cloudflare/vitest-plugin:config`) that re-exports from `cloudflare:test-internal` (runtime-provided). ## CONVENTIONS @@ -57,5 +57,5 @@ Resolved by custom Vite plugin (`@cloudflare/vitest-pool-workers:config`) that r - Hook timeout: 60s, retry: 2 - Global setup starts mock npm registry, installs local package to temp dir - Test helper: custom `test` fixture with `tmpPath`, `seed()`, `vitestRun()`, `vitestDev()` -- Fixtures in `fixtures/vitest-pool-workers-examples/` (20+ sub-fixtures testing KV, R2, D1, DO, Queues, etc.) +- Fixtures in `fixtures/vitest-plugin-examples/` (20+ sub-fixtures testing KV, R2, D1, DO, Queues, etc.) - Skipped on Windows CI due to flakiness diff --git a/packages/vitest-pool-workers/CHANGELOG.md b/packages/vitest-plugin/CHANGELOG.md similarity index 100% rename from packages/vitest-pool-workers/CHANGELOG.md rename to packages/vitest-plugin/CHANGELOG.md diff --git a/packages/vitest-pool-workers/CONTRIBUTING.md b/packages/vitest-plugin/CONTRIBUTING.md similarity index 76% rename from packages/vitest-pool-workers/CONTRIBUTING.md rename to packages/vitest-plugin/CONTRIBUTING.md index 344551b101a..a0ca9d29b31 100644 --- a/packages/vitest-pool-workers/CONTRIBUTING.md +++ b/packages/vitest-plugin/CONTRIBUTING.md @@ -4,4 +4,4 @@ Refer to the [announcement blog post](https://blog.cloudflare.com/workers-vitest-integration) for an overview of the implementation. -![Workers Vitest Integration Architecture](./vitest-pool-workers.svg) +![Workers Vitest Integration Architecture](./vitest-plugin.svg) diff --git a/packages/vitest-pool-workers/README.md b/packages/vitest-plugin/README.md similarity index 83% rename from packages/vitest-pool-workers/README.md rename to packages/vitest-plugin/README.md index 5ecaf416219..30e4fb07ada 100644 --- a/packages/vitest-pool-workers/README.md +++ b/packages/vitest-plugin/README.md @@ -1,7 +1,7 @@ -# `@cloudflare/vitest-pool-workers` +# `@cloudflare/vitest-plugin` The Workers Vitest integration allows you to write Vitest tests that run inside the Workers runtime. -Refer to the [documentation](https://developers.cloudflare.com/workers/testing/vitest-integration/) and [examples](https://github.com/cloudflare/workers-sdk/tree/main/fixtures/vitest-pool-workers-examples/) for more information. +Refer to the [documentation](https://developers.cloudflare.com/workers/testing/vitest-integration/) and [examples](https://github.com/cloudflare/workers-sdk/tree/main/fixtures/vitest-plugin-examples/) for more information. - ✅ Supports both **unit tests** and **integration tests** - 📚 Provides direct access to Workers runtime APIs and bindings diff --git a/packages/vitest-pool-workers/package.json b/packages/vitest-plugin/package.json similarity index 90% rename from packages/vitest-pool-workers/package.json rename to packages/vitest-plugin/package.json index 91baa7f4523..842db8cd5bd 100644 --- a/packages/vitest-pool-workers/package.json +++ b/packages/vitest-plugin/package.json @@ -1,5 +1,5 @@ { - "name": "@cloudflare/vitest-pool-workers", + "name": "@cloudflare/vitest-plugin", "version": "0.20.3", "description": "Workers Vitest integration for writing Vitest unit and integration tests that run inside the Workers runtime", "keywords": [ @@ -15,7 +15,7 @@ "worker", "workers" ], - "homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/vitest-pool-workers#readme", + "homepage": "https://github.com/cloudflare/workers-sdk/tree/main/packages/vitest-plugin#readme", "bugs": { "url": "https://github.com/cloudflare/workers-sdk/issues" }, @@ -23,7 +23,7 @@ "repository": { "type": "git", "url": "https://github.com/cloudflare/workers-sdk.git", - "directory": "packages/vitest-pool-workers" + "directory": "packages/vitest-plugin" }, "files": [ "dist", @@ -42,6 +42,9 @@ }, "./codemods/vitest-v3-to-v4": { "import": "./dist/codemods/vitest-v3-to-v4.mjs" + }, + "./codemods/vitest-pool-workers-to-vitest-plugin": { + "import": "./dist/codemods/vitest-pool-workers-to-vitest-plugin.mjs" } }, "scripts": { diff --git a/packages/vitest-pool-workers/scripts/deps.ts b/packages/vitest-plugin/scripts/deps.ts similarity index 96% rename from packages/vitest-pool-workers/scripts/deps.ts rename to packages/vitest-plugin/scripts/deps.ts index 712bd38ce6e..ca95e741ab9 100644 --- a/packages/vitest-pool-workers/scripts/deps.ts +++ b/packages/vitest-plugin/scripts/deps.ts @@ -1,5 +1,5 @@ /** - * Dependencies that _are not_ bundled along with @cloudflare/vitest-pool-workers. + * Dependencies that _are not_ bundled along with @cloudflare/vitest-plugin. * * These must be explicitly documented with a reason why they cannot be bundled. * This list is validated by `tools/deployments/validate-package-dependencies.ts`. diff --git a/packages/vitest-pool-workers/scripts/rtti/query.mjs b/packages/vitest-plugin/scripts/rtti/query.mjs similarity index 100% rename from packages/vitest-pool-workers/scripts/rtti/query.mjs rename to packages/vitest-plugin/scripts/rtti/query.mjs diff --git a/packages/vitest-pool-workers/scripts/rtti/rtti.capnp b/packages/vitest-plugin/scripts/rtti/rtti.capnp similarity index 100% rename from packages/vitest-pool-workers/scripts/rtti/rtti.capnp rename to packages/vitest-plugin/scripts/rtti/rtti.capnp diff --git a/packages/vitest-pool-workers/scripts/rtti/rtti.js b/packages/vitest-plugin/scripts/rtti/rtti.js similarity index 100% rename from packages/vitest-pool-workers/scripts/rtti/rtti.js rename to packages/vitest-plugin/scripts/rtti/rtti.js diff --git a/packages/vitest-plugin/src/codemods/vitest-pool-workers-to-vitest-plugin.ts b/packages/vitest-plugin/src/codemods/vitest-pool-workers-to-vitest-plugin.ts new file mode 100644 index 00000000000..14bc3d8573b --- /dev/null +++ b/packages/vitest-plugin/src/codemods/vitest-pool-workers-to-vitest-plugin.ts @@ -0,0 +1,113 @@ +/** + * jscodeshift codemod: migrate from `@cloudflare/vitest-pool-workers` to + * `@cloudflare/vitest-plugin` (v1). + * + * The package was renamed in v1. This rewrites the package specifier in all + * `import`/`export ... from`/`require()` statements, preserving any subpath + * (e.g. `/config`, `/types`): + * + * import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; + * import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config"; + * + * Into: + * + * import { cloudflareTest } from "@cloudflare/vitest-plugin"; + * import { defineWorkersProject } from "@cloudflare/vitest-plugin/config"; + * + * Usage: + * npx jscodeshift -t node_modules/@cloudflare/vitest-plugin/dist/codemods/vitest-pool-workers-to-vitest-plugin.mjs vitest.config.ts + */ + +const OLD_NAME = "@cloudflare/vitest-pool-workers"; +const NEW_NAME = "@cloudflare/vitest-plugin"; + +// Minimal jscodeshift types — avoids requiring @types/jscodeshift as a dependency. +interface FileInfo { + path: string; + source: string; +} +interface ASTType { + name: string; +} +interface ASTNode { + type: string; +} +interface LiteralNode extends ASTNode { + value: unknown; +} +interface NodePath { + node: T; +} +interface Collection { + find(type: ASTType, filter?: Record): Collection; + // eslint-disable-next-line @typescript-eslint/no-explicit-any -- jscodeshift Collection.forEach accepts callbacks with narrowed NodePath types + forEach(callback: (path: NodePath) => void): Collection; + length: number; + toSource(): string; +} +interface JSCodeshift { + (source: string): Collection; + ImportDeclaration: ASTType; + ExportNamedDeclaration: ASTType; + ExportAllDeclaration: ASTType; + CallExpression: ASTType; + Literal: { check(node: unknown): node is LiteralNode }; + StringLiteral: { check(node: unknown): node is LiteralNode }; +} +interface API { + jscodeshift: JSCodeshift; +} + +function rename(value: unknown): string | undefined { + if (typeof value !== "string") { + return undefined; + } + if (value === OLD_NAME) { + return NEW_NAME; + } + if (value.startsWith(`${OLD_NAME}/`)) { + return NEW_NAME + value.slice(OLD_NAME.length); + } + return undefined; +} + +export default function transform(fileInfo: FileInfo, api: API): string { + const j = api.jscodeshift; + const root = j(fileInfo.source); + + // import/export ... from "@cloudflare/vitest-pool-workers[/...]" + for (const type of [ + j.ImportDeclaration, + j.ExportNamedDeclaration, + j.ExportAllDeclaration, + ]) { + root.find(type).forEach((path: NodePath<{ source?: LiteralNode }>) => { + const source = path.node.source; + if (!source) { + return; + } + const next = rename(source.value); + if (next !== undefined) { + source.value = next; + } + }); + } + + // require("@cloudflare/vitest-pool-workers[/...]") + root + .find(j.CallExpression, { callee: { name: "require" } }) + .forEach((path: NodePath<{ arguments: ASTNode[] }>) => { + const arg = path.node.arguments[0]; + if (arg && (j.Literal.check(arg) || j.StringLiteral.check(arg))) { + const next = rename(arg.value); + if (next !== undefined) { + arg.value = next; + } + } + }); + + return root.toSource(); +} + +// Tell jscodeshift to use the TypeScript parser +export const parser = "ts"; diff --git a/packages/vitest-pool-workers/src/codemods/vitest-v3-to-v4.ts b/packages/vitest-plugin/src/codemods/vitest-v3-to-v4.ts similarity index 100% rename from packages/vitest-pool-workers/src/codemods/vitest-v3-to-v4.ts rename to packages/vitest-plugin/src/codemods/vitest-v3-to-v4.ts diff --git a/packages/vitest-pool-workers/src/pool/cloudflare-pool-worker.ts b/packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts similarity index 98% rename from packages/vitest-pool-workers/src/pool/cloudflare-pool-worker.ts rename to packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts index 9317557b184..769770bdf8b 100644 --- a/packages/vitest-pool-workers/src/pool/cloudflare-pool-worker.ts +++ b/packages/vitest-plugin/src/pool/cloudflare-pool-worker.ts @@ -83,12 +83,12 @@ export class CloudflarePoolWorker implements PoolWorker { this.parsedPoolOptions ); - // Find the vitest-pool-workers plugin and give it the path to the main file. + // Find the vitest-plugin plugin and give it the path to the main file. // This allows that plugin to inject a virtual dependency on main so that vitest // will automatically re-run tests when that gets updated, avoiding the user having // to manually add such an import in their tests. const configPlugin = this.options.project.vite.config.plugins.find( - ({ name }) => name === "@cloudflare/vitest-pool-workers" + ({ name }) => name === "@cloudflare/vitest-plugin" ); if (configPlugin !== undefined) { const api = configPlugin.api as WorkersConfigPluginAPI; @@ -234,7 +234,7 @@ export class CloudflarePoolWorker implements PoolWorker { const specifier = d.a[0]; if ( - // `cloudflare:test` imports are handled by the `@cloudflare/vitest-pool-workers` plugin, and so should be ignored here + // `cloudflare:test` imports are handled by the `@cloudflare/vitest-plugin` plugin, and so should be ignored here specifier !== "cloudflare:test" && (/^(cloudflare|workerd):/.test(specifier) || workerdBuiltinModules.has(specifier)) diff --git a/packages/vitest-pool-workers/src/pool/compatibility-flag-assertions.ts b/packages/vitest-plugin/src/pool/compatibility-flag-assertions.ts similarity index 97% rename from packages/vitest-pool-workers/src/pool/compatibility-flag-assertions.ts rename to packages/vitest-plugin/src/pool/compatibility-flag-assertions.ts index aaa9574393c..48756704c95 100644 --- a/packages/vitest-pool-workers/src/pool/compatibility-flag-assertions.ts +++ b/packages/vitest-plugin/src/pool/compatibility-flag-assertions.ts @@ -87,7 +87,7 @@ export class CompatibilityFlagAssertions { if (this.#flagExists(disableFlag)) { const errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath( "compatibility_flags" - )} must not contain "${disableFlag}".\nThis flag is incompatible with \`@cloudflare/vitest-pool-workers\`.`; + )} must not contain "${disableFlag}".\nThis flag is incompatible with \`@cloudflare/vitest-plugin\`.`; return { isValid: false, errorMessage }; } @@ -108,7 +108,7 @@ export class CompatibilityFlagAssertions { )} must be >= "${defaultOnDate}".`; } - errorMessage += `\nThis flag is required to use \`@cloudflare/vitest-pool-workers\`.`; + errorMessage += `\nThis flag is required to use \`@cloudflare/vitest-plugin\`.`; return { isValid: false, errorMessage }; } @@ -126,7 +126,7 @@ export class CompatibilityFlagAssertions { const errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath( "compatibility_flags" - )} must contain one of ${flags.map((flag) => `"${flag}"`).join("/")}.\nEither one of these flags is required to use \`@cloudflare/vitest-pool-workers\`.`; + )} must contain one of ${flags.map((flag) => `"${flag}"`).join("/")}.\nEither one of these flags is required to use \`@cloudflare/vitest-plugin\`.`; return { isValid: false, errorMessage }; } diff --git a/packages/vitest-pool-workers/src/pool/config.ts b/packages/vitest-plugin/src/pool/config.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/config.ts rename to packages/vitest-plugin/src/pool/config.ts diff --git a/packages/vitest-pool-workers/src/pool/d1.ts b/packages/vitest-plugin/src/pool/d1.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/d1.ts rename to packages/vitest-plugin/src/pool/d1.ts diff --git a/packages/vitest-pool-workers/src/pool/guess-exports.ts b/packages/vitest-plugin/src/pool/guess-exports.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/guess-exports.ts rename to packages/vitest-plugin/src/pool/guess-exports.ts diff --git a/packages/vitest-pool-workers/src/pool/helpers.ts b/packages/vitest-plugin/src/pool/helpers.ts similarity index 92% rename from packages/vitest-pool-workers/src/pool/helpers.ts rename to packages/vitest-plugin/src/pool/helpers.ts index d6f67e03f66..c640c31641f 100644 --- a/packages/vitest-pool-workers/src/pool/helpers.ts +++ b/packages/vitest-plugin/src/pool/helpers.ts @@ -2,7 +2,7 @@ import path from "node:path"; import type { TestProject } from "vitest/node"; // User worker names must not start with this -export const WORKER_NAME_PREFIX = "vitest-pool-workers-"; +export const WORKER_NAME_PREFIX = "vitest-plugin-"; export function isFileNotFoundError(e: unknown): boolean { return ( diff --git a/packages/vitest-pool-workers/src/pool/index.ts b/packages/vitest-plugin/src/pool/index.ts similarity index 97% rename from packages/vitest-pool-workers/src/pool/index.ts rename to packages/vitest-plugin/src/pool/index.ts index 215605e288c..3e75a286eb3 100644 --- a/packages/vitest-pool-workers/src/pool/index.ts +++ b/packages/vitest-plugin/src/pool/index.ts @@ -69,8 +69,8 @@ export function structuredSerializableParse(value: string): unknown { // Log for pool info/warnings/errors (user-actionable messages only) const log = new Log(LogLevel.INFO, { prefix: "vpw" }); -// Debug log gated behind NODE_DEBUG=vitest-pool-workers -const debug = util.debuglog("vitest-pool-workers"); +// Debug log gated behind NODE_DEBUG=vitest-plugin +const debug = util.debuglog("vitest-plugin"); // Log for Miniflare instances, used for user code warnings/errors const mfLog = new Log(LogLevel.WARN); @@ -347,7 +347,7 @@ async function buildProjectWorkerOptions( // By default, workerd tracks which request context a promise was created in // and rejects promises that resolve in a different request context. This is a // safety feature for production Workers to prevent data leaking between - // requests. However, vitest-pool-workers runs all test files within the same + // requests. However, vitest-plugin runs all test files within the same // Durable Object, so promise resolution regularly crosses request boundaries // (e.g. a setup promise created for one test file resolving during another). // Without this flag, those promises get rejected and tests break. @@ -821,7 +821,7 @@ export function assertCompatibleVitestVersion(ctx: Vitest) { const vitestPkgJson = getPackageJson(ctx.distPath); assert( poolPkgJson !== undefined, - "Expected to find `package.json` for `@cloudflare/vitest-pool-workers`" + "Expected to find `package.json` for `@cloudflare/vitest-plugin`" ); assert( vitestPkgJson !== undefined, @@ -831,7 +831,7 @@ export function assertCompatibleVitestVersion(ctx: Vitest) { const expectedVitestVersion = poolPkgJson.peerDependencies?.vitest; assert( expectedVitestVersion !== undefined, - "Expected to find `@cloudflare/vitest-pool-workers`'s `vitest` version constraint" + "Expected to find `@cloudflare/vitest-plugin`'s `vitest` version constraint" ); const actualVitestVersion = @@ -845,14 +845,14 @@ export function assertCompatibleVitestVersion(ctx: Vitest) { // Hard error on Vitest v3, which definitely won't work if (semverSatisfies(actualVitestVersion, "3.x")) { - const message = `You're running \`vitest@${actualVitestVersion}\`, but this version of \`@cloudflare/vitest-pool-workers\` only supports \`vitest ${expectedVitestVersion}\`.`; + const message = `You're running \`vitest@${actualVitestVersion}\`, but this version of \`@cloudflare/vitest-plugin\` only supports \`vitest ${expectedVitestVersion}\`.`; throw new Error(message); } if (!semverSatisfies(actualVitestVersion, expectedVitestVersion)) { const message = [ - `You're running \`vitest@${actualVitestVersion}\`, but this version of \`@cloudflare/vitest-pool-workers\` only officially supports \`vitest ${expectedVitestVersion}\`.`, - "`@cloudflare/vitest-pool-workers` currently depends on internal Vitest APIs that are not protected by semantic-versioning guarantees.", + `You're running \`vitest@${actualVitestVersion}\`, but this version of \`@cloudflare/vitest-plugin\` only officially supports \`vitest ${expectedVitestVersion}\`.`, + "`@cloudflare/vitest-plugin` currently depends on internal Vitest APIs that are not protected by semantic-versioning guarantees.", `Your tests may work without issue, but we can not guarantee compatibility outside of the above version range.`, ].join("\n"); log.warn(message); diff --git a/packages/vitest-pool-workers/src/pool/loopback.ts b/packages/vitest-plugin/src/pool/loopback.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/loopback.ts rename to packages/vitest-plugin/src/pool/loopback.ts diff --git a/packages/vitest-pool-workers/src/pool/module-fallback.ts b/packages/vitest-plugin/src/pool/module-fallback.ts similarity index 99% rename from packages/vitest-pool-workers/src/pool/module-fallback.ts rename to packages/vitest-plugin/src/pool/module-fallback.ts index a58a378e959..0d2cc27a60d 100644 --- a/packages/vitest-pool-workers/src/pool/module-fallback.ts +++ b/packages/vitest-plugin/src/pool/module-fallback.ts @@ -13,7 +13,7 @@ import type { ModuleRuleType, Request, Worker_Module } from "miniflare"; import type { Vite } from "vitest/node"; let debuglog: util.DebugLoggerFunction = util.debuglog( - "vitest-pool-workers:module-fallback", + "vitest-plugin:module-fallback", (log) => (debuglog = log) ); @@ -291,7 +291,7 @@ async function viteResolve( // - looks like a built-in node module but wasn't imported with a `node:` prefix // - and isn't provided by workerd natively // In that case, _try_ and load the identifier with a `node:` prefix. - // This will potentially load one of the Node.js polyfills provided by `vitest-pool-workers` + // This will potentially load one of the Node.js polyfills provided by `vitest-plugin` // Note: User imports should never get here! This is only meant to cater for Vitest internals // (Specifically, the "tinyrainbow" module imports `node:tty` as `tty`) return id; @@ -684,7 +684,7 @@ export async function handleModuleFallbackRequest( } catch (e) { debuglog(logBase, "error:", e); console.error( - `[vitest-pool-workers] Failed to ${method} ${JSON.stringify(target)} from ${JSON.stringify(referrer)}.`, + `[vitest-plugin] Failed to ${method} ${JSON.stringify(target)} from ${JSON.stringify(referrer)}.`, "To resolve this, try bundling the relevant dependency with Vite.", "For more details, refer to https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#module-resolution" ); diff --git a/packages/vitest-pool-workers/src/pool/pages.ts b/packages/vitest-plugin/src/pool/pages.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/pages.ts rename to packages/vitest-plugin/src/pool/pages.ts diff --git a/packages/vitest-pool-workers/src/pool/plugin.ts b/packages/vitest-plugin/src/pool/plugin.ts similarity index 98% rename from packages/vitest-pool-workers/src/pool/plugin.ts rename to packages/vitest-plugin/src/pool/plugin.ts index 28388f4fded..0d5a09c42de 100644 --- a/packages/vitest-pool-workers/src/pool/plugin.ts +++ b/packages/vitest-plugin/src/pool/plugin.ts @@ -49,7 +49,7 @@ export function cloudflareTest( const uuid = crypto.randomUUID(); let main: string | undefined; return { - name: "@cloudflare/vitest-pool-workers", + name: "@cloudflare/vitest-plugin", api: { setMain(newMain: string) { main = newMain; @@ -82,7 +82,7 @@ export function cloudflareTest( const provider = "provider" in coverage ? coverage.provider : undefined; if (provider === "v8" || provider === undefined) { const lines = [ - 'Coverage provider "v8" is not supported by `@cloudflare/vitest-pool-workers`.', + 'Coverage provider "v8" is not supported by `@cloudflare/vitest-plugin`.', "V8 native coverage requires `node:inspector` which is not functional in the Workers runtime.", "", "Use Istanbul instead — it works by instrumenting source code and runs on any JavaScript runtime:", diff --git a/packages/vitest-pool-workers/src/pool/pool.ts b/packages/vitest-plugin/src/pool/pool.ts similarity index 100% rename from packages/vitest-pool-workers/src/pool/pool.ts rename to packages/vitest-plugin/src/pool/pool.ts diff --git a/packages/vitest-pool-workers/src/shared/builtin-modules.ts b/packages/vitest-plugin/src/shared/builtin-modules.ts similarity index 100% rename from packages/vitest-pool-workers/src/shared/builtin-modules.ts rename to packages/vitest-plugin/src/shared/builtin-modules.ts diff --git a/packages/vitest-pool-workers/src/shared/d1.ts b/packages/vitest-plugin/src/shared/d1.ts similarity index 100% rename from packages/vitest-pool-workers/src/shared/d1.ts rename to packages/vitest-plugin/src/shared/d1.ts diff --git a/packages/vitest-pool-workers/src/shared/types-global.d.ts b/packages/vitest-plugin/src/shared/types-global.d.ts similarity index 100% rename from packages/vitest-pool-workers/src/shared/types-global.d.ts rename to packages/vitest-plugin/src/shared/types-global.d.ts diff --git a/packages/vitest-pool-workers/src/worker/d1.ts b/packages/vitest-plugin/src/worker/d1.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/d1.ts rename to packages/vitest-plugin/src/worker/d1.ts diff --git a/packages/vitest-pool-workers/src/worker/durable-objects.ts b/packages/vitest-plugin/src/worker/durable-objects.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/durable-objects.ts rename to packages/vitest-plugin/src/worker/durable-objects.ts diff --git a/packages/vitest-pool-workers/src/worker/entrypoints.ts b/packages/vitest-plugin/src/worker/entrypoints.ts similarity index 99% rename from packages/vitest-pool-workers/src/worker/entrypoints.ts rename to packages/vitest-plugin/src/worker/entrypoints.ts index 4824c44319a..29cf1f2144b 100644 --- a/packages/vitest-pool-workers/src/worker/entrypoints.ts +++ b/packages/vitest-plugin/src/worker/entrypoints.ts @@ -299,7 +299,7 @@ async function getWorkerEntrypointExport( mainModule[entrypoint]; if (!entrypointValue) { const message = - `${mainPath} does not export a ${entrypoint} entrypoint. \`@cloudflare/vitest-pool-workers\` does not support service workers or named entrypoints for \`SELF\`.\n` + + `${mainPath} does not export a ${entrypoint} entrypoint. \`@cloudflare/vitest-plugin\` does not support service workers or named entrypoints for \`SELF\`.\n` + "If you're using service workers, please migrate to the modules format: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/"; throw new TypeError(message); } diff --git a/packages/vitest-pool-workers/src/worker/env.ts b/packages/vitest-plugin/src/worker/env.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/env.ts rename to packages/vitest-plugin/src/worker/env.ts diff --git a/packages/vitest-pool-workers/src/worker/events.ts b/packages/vitest-plugin/src/worker/events.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/events.ts rename to packages/vitest-plugin/src/worker/events.ts diff --git a/packages/vitest-pool-workers/src/worker/index.ts b/packages/vitest-plugin/src/worker/index.ts similarity index 99% rename from packages/vitest-pool-workers/src/worker/index.ts rename to packages/vitest-plugin/src/worker/index.ts index 5efe67ec072..bbb70401cc5 100644 --- a/packages/vitest-pool-workers/src/worker/index.ts +++ b/packages/vitest-plugin/src/worker/index.ts @@ -283,7 +283,7 @@ export class __VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__ extends DurableObject }; } else { __console.warn( - "[vitest-pool-workers] Could not patch module runner transport. " + + "[vitest-plugin] Could not patch module runner transport. " + "Dynamic import() inside entrypoint/DO handlers may fail." ); } diff --git a/packages/vitest-pool-workers/src/worker/lib/README.md b/packages/vitest-plugin/src/worker/lib/README.md similarity index 100% rename from packages/vitest-pool-workers/src/worker/lib/README.md rename to packages/vitest-plugin/src/worker/lib/README.md diff --git a/packages/vitest-pool-workers/src/worker/lib/cloudflare/empty-internal.cts b/packages/vitest-plugin/src/worker/lib/cloudflare/empty-internal.cts similarity index 100% rename from packages/vitest-pool-workers/src/worker/lib/cloudflare/empty-internal.cts rename to packages/vitest-plugin/src/worker/lib/cloudflare/empty-internal.cts diff --git a/packages/vitest-pool-workers/src/worker/lib/cloudflare/snapshot.ts b/packages/vitest-plugin/src/worker/lib/cloudflare/snapshot.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/lib/cloudflare/snapshot.ts rename to packages/vitest-plugin/src/worker/lib/cloudflare/snapshot.ts diff --git a/packages/vitest-pool-workers/src/worker/lib/cloudflare/test-internal.ts b/packages/vitest-plugin/src/worker/lib/cloudflare/test-internal.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/lib/cloudflare/test-internal.ts rename to packages/vitest-plugin/src/worker/lib/cloudflare/test-internal.ts diff --git a/packages/vitest-pool-workers/src/worker/lib/cloudflare/test.ts b/packages/vitest-plugin/src/worker/lib/cloudflare/test.ts similarity index 91% rename from packages/vitest-pool-workers/src/worker/lib/cloudflare/test.ts rename to packages/vitest-plugin/src/worker/lib/cloudflare/test.ts index 84c269f639c..278a61ffd7b 100644 --- a/packages/vitest-pool-workers/src/worker/lib/cloudflare/test.ts +++ b/packages/vitest-plugin/src/worker/lib/cloudflare/test.ts @@ -1,6 +1,6 @@ // This module is special. Rather than being externalised and returned by the // module fallback service, it gets resolved and loaded by the -// `@cloudflare/vitest-pool-workers:config` Vite plugin. This allows us to +// `@cloudflare/vitest-plugin:config` Vite plugin. This allows us to // inject a side-effect-only `import` for the configured `main` entrypoint. // This registers a dependency on `main`, ensuring integration tests using // `SELF` re-run when `main` changes. diff --git a/packages/vitest-pool-workers/src/worker/node/console.ts b/packages/vitest-plugin/src/worker/node/console.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/node/console.ts rename to packages/vitest-plugin/src/worker/node/console.ts diff --git a/packages/vitest-pool-workers/src/worker/node/vm.ts b/packages/vitest-plugin/src/worker/node/vm.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/node/vm.ts rename to packages/vitest-plugin/src/worker/node/vm.ts diff --git a/packages/vitest-pool-workers/src/worker/patch-ctx.ts b/packages/vitest-plugin/src/worker/patch-ctx.ts similarity index 93% rename from packages/vitest-pool-workers/src/worker/patch-ctx.ts rename to packages/vitest-plugin/src/worker/patch-ctx.ts index cbbe8628eaf..64460d67543 100644 --- a/packages/vitest-pool-workers/src/worker/patch-ctx.ts +++ b/packages/vitest-plugin/src/worker/patch-ctx.ts @@ -50,7 +50,7 @@ export function getCtxExportsProxy( console.warn( `Attempted to access 'ctx.exports.${p}', which was not defined for the main Worker.\n` + `Check that '${p}' is exported as an entry-point from the Worker.\n` + - `The '@cloudflare/vitest-pool-workers' integration tries to infer these exports by analyzing the source code of the main Worker.\n` + `The '@cloudflare/vitest-plugin' integration tries to infer these exports by analyzing the source code of the main Worker.\n` ); return undefined; }, diff --git a/packages/vitest-pool-workers/src/worker/reset.ts b/packages/vitest-plugin/src/worker/reset.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/reset.ts rename to packages/vitest-plugin/src/worker/reset.ts diff --git a/packages/vitest-pool-workers/src/worker/secrets-store.ts b/packages/vitest-plugin/src/worker/secrets-store.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/secrets-store.ts rename to packages/vitest-plugin/src/worker/secrets-store.ts diff --git a/packages/vitest-pool-workers/src/worker/tsconfig.json b/packages/vitest-plugin/src/worker/tsconfig.json similarity index 100% rename from packages/vitest-pool-workers/src/worker/tsconfig.json rename to packages/vitest-plugin/src/worker/tsconfig.json diff --git a/packages/vitest-pool-workers/src/worker/types-ambient.d.ts b/packages/vitest-plugin/src/worker/types-ambient.d.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/types-ambient.d.ts rename to packages/vitest-plugin/src/worker/types-ambient.d.ts diff --git a/packages/vitest-pool-workers/src/worker/types-globals.d.ts b/packages/vitest-plugin/src/worker/types-globals.d.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/types-globals.d.ts rename to packages/vitest-plugin/src/worker/types-globals.d.ts diff --git a/packages/vitest-pool-workers/src/worker/wait-until.ts b/packages/vitest-plugin/src/worker/wait-until.ts similarity index 97% rename from packages/vitest-pool-workers/src/worker/wait-until.ts rename to packages/vitest-plugin/src/worker/wait-until.ts index a88f2c1f238..386319ca6e6 100644 --- a/packages/vitest-pool-workers/src/worker/wait-until.ts +++ b/packages/vitest-plugin/src/worker/wait-until.ts @@ -43,7 +43,7 @@ export async function waitForWaitUntil( if (result === kTimedOut) { __console.warn( - `[vitest-pool-workers] ${batch.length} waitUntil promise(s) did not ` + + `[vitest-plugin] ${batch.length} waitUntil promise(s) did not ` + `resolve within ${WAIT_UNTIL_TIMEOUT / 1000}s and will be abandoned. ` + `This normally means your Worker's waitUntil handler has a bug ` + `that prevents it from settling (e.g. a fetch that never completes ` + diff --git a/packages/vitest-pool-workers/src/worker/workflows.ts b/packages/vitest-plugin/src/worker/workflows.ts similarity index 100% rename from packages/vitest-pool-workers/src/worker/workflows.ts rename to packages/vitest-plugin/src/worker/workflows.ts diff --git a/packages/vitest-plugin/test/README.md b/packages/vitest-plugin/test/README.md new file mode 100644 index 00000000000..ab9430d9b0e --- /dev/null +++ b/packages/vitest-plugin/test/README.md @@ -0,0 +1,11 @@ +# `@cloudflare/vitest-plugin` E2E Tests + +This directory implements E2E tests for the `@cloudflare/vitest-plugin` package. + +`@cloudflare/vitest-plugin` and its local dependencies are built and then published to a mock npm registry, then installed in a temporary directory to test against. + +If possible, tests should be written in the [`fixtures/vitest-plugin-examples`](../../../fixtures/vitest-plugin-examples) directory. +These tests run against `@cloudflare/vitest-plugin` itself, and execute much faster. +They're also a source of documentation for end users. + +Use the [`misc`](../../../fixtures/vitest-plugin-examples/misc) directory if your test doesn't really belong with an example. diff --git a/packages/vitest-pool-workers/test/bindings.test.ts b/packages/vitest-plugin/test/bindings.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/bindings.test.ts rename to packages/vitest-plugin/test/bindings.test.ts diff --git a/packages/vitest-pool-workers/test/chunking.test.ts b/packages/vitest-plugin/test/chunking.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/chunking.test.ts rename to packages/vitest-plugin/test/chunking.test.ts diff --git a/packages/vitest-plugin/test/codemods-rename.test.ts b/packages/vitest-plugin/test/codemods-rename.test.ts new file mode 100644 index 00000000000..41185178146 --- /dev/null +++ b/packages/vitest-plugin/test/codemods-rename.test.ts @@ -0,0 +1,48 @@ +import jscodeshift from "jscodeshift"; +import { describe, it } from "vitest"; +import transform from "../src/codemods/vitest-pool-workers-to-vitest-plugin"; + +function run(source: string): string { + return transform( + { path: "vitest.config.ts", source }, + // Cast needed: @types/jscodeshift's full JSCodeshift type is structurally + // incompatible with the codemod's minimal JSCodeshift interface, but they + // are compatible at runtime. + { jscodeshift: jscodeshift.withParser("ts") as never } + ); +} + +describe("vitest-pool-workers-to-vitest-plugin codemod", () => { + it("renames the bare package import", ({ expect }) => { + const input = `import { cloudflareTest } from "@cloudflare/vitest-pool-workers";`; + expect(run(input)).toBe( + `import { cloudflareTest } from "@cloudflare/vitest-plugin";` + ); + }); + + it("preserves subpath imports such as /config", ({ expect }) => { + const input = `import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config";`; + expect(run(input)).toBe( + `import { defineWorkersProject } from "@cloudflare/vitest-plugin/config";` + ); + }); + + it("renames re-exports", ({ expect }) => { + const input = `export { cloudflareTest } from "@cloudflare/vitest-pool-workers";`; + expect(run(input)).toBe( + `export { cloudflareTest } from "@cloudflare/vitest-plugin";` + ); + }); + + it("renames require() calls", ({ expect }) => { + const input = `const { cloudflareTest } = require("@cloudflare/vitest-pool-workers");`; + expect(run(input)).toBe( + `const { cloudflareTest } = require("@cloudflare/vitest-plugin");` + ); + }); + + it("leaves unrelated imports untouched", ({ expect }) => { + const input = `import { defineConfig } from "vitest/config";`; + expect(run(input)).toBe(input); + }); +}); diff --git a/packages/vitest-pool-workers/test/codemods.test.ts b/packages/vitest-plugin/test/codemods.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/codemods.test.ts rename to packages/vitest-plugin/test/codemods.test.ts diff --git a/packages/vitest-pool-workers/test/compatibility-flag-assertions.test.ts b/packages/vitest-plugin/test/compatibility-flag-assertions.test.ts similarity index 96% rename from packages/vitest-pool-workers/test/compatibility-flag-assertions.test.ts rename to packages/vitest-plugin/test/compatibility-flag-assertions.test.ts index bd7f71656ce..f744d9ee384 100644 --- a/packages/vitest-pool-workers/test/compatibility-flag-assertions.test.ts +++ b/packages/vitest-plugin/test/compatibility-flag-assertions.test.ts @@ -19,7 +19,7 @@ describe("FlagAssertions", () => { }); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-plugin`.' ); }); @@ -37,7 +37,7 @@ describe("FlagAssertions", () => { }); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-plugin`.' ); }); @@ -56,7 +56,7 @@ describe("FlagAssertions", () => { }); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project\'s configuration file wrangler.toml, `compatibility_flags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project\'s configuration file wrangler.toml, `compatibility_flags` must not contain "disable-flag".\nThis flag is incompatible with `@cloudflare/vitest-plugin`.' ); }); }); @@ -108,7 +108,7 @@ describe("FlagAssertions", () => { }); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must contain "enable-flag", or `options.compatibilityDate` must be >= "2023-01-01".\nThis flag is required to use `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must contain "enable-flag", or `options.compatibilityDate` must be >= "2023-01-01".\nThis flag is required to use `@cloudflare/vitest-plugin`.' ); }); @@ -128,7 +128,7 @@ describe("FlagAssertions", () => { }); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must contain "enable-flag", or `options.compatibilityDate` must be >= "2023-01-01".\nThis flag is required to use `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must contain "enable-flag", or `options.compatibilityDate` must be >= "2023-01-01".\nThis flag is required to use `@cloudflare/vitest-plugin`.' ); }); @@ -206,7 +206,7 @@ describe("FlagAssertions", () => { ]); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must contain one of "flag2"/"flag3".\nEither one of these flags is required to use `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must contain one of "flag2"/"flag3".\nEither one of these flags is required to use `@cloudflare/vitest-plugin`.' ); }); @@ -226,7 +226,7 @@ describe("FlagAssertions", () => { ]); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project\'s configuration file wrangler.toml, `compatibility_flags` must contain one of "flag2"/"flag3".\nEither one of these flags is required to use `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project\'s configuration file wrangler.toml, `compatibility_flags` must contain one of "flag2"/"flag3".\nEither one of these flags is required to use `@cloudflare/vitest-plugin`.' ); }); @@ -258,7 +258,7 @@ describe("FlagAssertions", () => { ]); expect(result.isValid).toBe(false); expect(result.errorMessage).toBe( - 'In project /path/to/project, `options.compatibilityFlags` must contain one of "flag1"/"flag2".\nEither one of these flags is required to use `@cloudflare/vitest-pool-workers`.' + 'In project /path/to/project, `options.compatibilityFlags` must contain one of "flag1"/"flag2".\nEither one of these flags is required to use `@cloudflare/vitest-plugin`.' ); }); diff --git a/packages/vitest-pool-workers/test/console.test.ts b/packages/vitest-plugin/test/console.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/console.test.ts rename to packages/vitest-plugin/test/console.test.ts diff --git a/packages/vitest-pool-workers/test/coverage.test.ts b/packages/vitest-plugin/test/coverage.test.ts similarity index 98% rename from packages/vitest-pool-workers/test/coverage.test.ts rename to packages/vitest-plugin/test/coverage.test.ts index 24a5d7ec9f7..b8da1fdcf9c 100644 --- a/packages/vitest-pool-workers/test/coverage.test.ts +++ b/packages/vitest-plugin/test/coverage.test.ts @@ -20,7 +20,7 @@ test( main: "src/index.ts", }), "vitest.config.mts": dedent /* javascript */ ` - import { cloudflareTest } from "@cloudflare/vitest-pool-workers" + import { cloudflareTest } from "@cloudflare/vitest-plugin" import { BaseSequencer } from "vitest/node"; class DeterministicSequencer extends BaseSequencer { diff --git a/packages/vitest-pool-workers/test/do-exports.test.ts b/packages/vitest-plugin/test/do-exports.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/do-exports.test.ts rename to packages/vitest-plugin/test/do-exports.test.ts diff --git a/packages/vitest-pool-workers/test/env.d.ts b/packages/vitest-plugin/test/env.d.ts similarity index 100% rename from packages/vitest-pool-workers/test/env.d.ts rename to packages/vitest-plugin/test/env.d.ts diff --git a/packages/vitest-pool-workers/test/file-url-import.test.ts b/packages/vitest-plugin/test/file-url-import.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/file-url-import.test.ts rename to packages/vitest-plugin/test/file-url-import.test.ts diff --git a/packages/vitest-pool-workers/test/filtering.test.ts b/packages/vitest-plugin/test/filtering.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/filtering.test.ts rename to packages/vitest-plugin/test/filtering.test.ts diff --git a/packages/vitest-pool-workers/test/global-setup.ts b/packages/vitest-plugin/test/global-setup.ts similarity index 85% rename from packages/vitest-pool-workers/test/global-setup.ts rename to packages/vitest-plugin/test/global-setup.ts index 5532d2dace8..542e734383e 100644 --- a/packages/vitest-pool-workers/test/global-setup.ts +++ b/packages/vitest-plugin/test/global-setup.ts @@ -14,7 +14,7 @@ const packagesRoot = path.resolve(repoRoot, "packages"); // Using a global setup means we can modify tests without having to re-install // packages into our temporary directory export default async function ({ provide }: TestProject) { - const stop = await startMockNpmRegistry("@cloudflare/vitest-pool-workers"); + const stop = await startMockNpmRegistry("@cloudflare/vitest-plugin"); // Create temporary directory const projectPath = await createTestProject(); @@ -33,23 +33,23 @@ export default async function ({ provide }: TestProject) { } /** - * Create a temporary package that contains vitest-pool-workers and vitest. + * Create a temporary package that contains vitest-plugin and vitest. */ async function createTestProject() { // Create temporary directory containing a space to avoid regressing on // https://github.com/cloudflare/workers-sdk/issues/5268 const projectPath = await fs.realpath( - await fs.mkdtemp(path.join(os.tmpdir(), "vitest-pool-workers temp-")) + await fs.mkdtemp(path.join(os.tmpdir(), "vitest-plugin temp-")) ); const packageJsonPath = path.join(projectPath, "package.json"); const vitestPeerDep = await getVitestPeerDep(); const packageJson = { - name: "vitest-pool-workers-e2e-tests", + name: "vitest-plugin-e2e-tests", private: true, type: "module", devDependencies: { - // Ensure we use the local version of vitest-pool-workers - "@cloudflare/vitest-pool-workers": version, + // Ensure we use the local version of vitest-plugin + "@cloudflare/vitest-plugin": version, "@vitest/coverage-istanbul": vitestPeerDep, vitest: vitestPeerDep, }, @@ -73,12 +73,12 @@ async function createTestProject() { } /** - * Get the version of `vitest` that is needed as a peer of vitest-pool-workers. + * Get the version of `vitest` that is needed as a peer of vitest-plugin. */ async function getVitestPeerDep() { const poolPackageJsonPath = path.join( packagesRoot, - "vitest-pool-workers/package.json" + "vitest-plugin/package.json" ); const poolPackageJson = JSON.parse( await fs.readFile(poolPackageJsonPath, "utf8") diff --git a/packages/vitest-pool-workers/test/helpers.ts b/packages/vitest-plugin/test/helpers.ts similarity index 97% rename from packages/vitest-pool-workers/test/helpers.ts rename to packages/vitest-plugin/test/helpers.ts index 24ac3bfad90..8ffa5916f04 100644 --- a/packages/vitest-pool-workers/test/helpers.ts +++ b/packages/vitest-plugin/test/helpers.ts @@ -9,13 +9,13 @@ import treeKill from "tree-kill"; import dedent from "ts-dedent"; import { test as baseTest, inject, vi } from "vitest"; -const debuglog = util.debuglog("vitest-pool-workers:test"); +const debuglog = util.debuglog("vitest-plugin:test"); export const vitestConfig = ( cfOptions: Record = {}, testOptions: Record = {} ) => dedent /* javascript */ ` - import { cloudflareTest } from "@cloudflare/vitest-pool-workers" + import { cloudflareTest } from "@cloudflare/vitest-plugin" import { BaseSequencer } from "vitest/node"; diff --git a/packages/vitest-pool-workers/test/inspector.test.ts b/packages/vitest-plugin/test/inspector.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/inspector.test.ts rename to packages/vitest-plugin/test/inspector.test.ts diff --git a/packages/vitest-pool-workers/test/isolation.test.ts b/packages/vitest-plugin/test/isolation.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/isolation.test.ts rename to packages/vitest-plugin/test/isolation.test.ts diff --git a/packages/vitest-pool-workers/test/module-fallback.test.ts b/packages/vitest-plugin/test/module-fallback.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/module-fallback.test.ts rename to packages/vitest-plugin/test/module-fallback.test.ts diff --git a/packages/vitest-pool-workers/test/remote-proxy-cleanup.test.ts b/packages/vitest-plugin/test/remote-proxy-cleanup.test.ts similarity index 96% rename from packages/vitest-pool-workers/test/remote-proxy-cleanup.test.ts rename to packages/vitest-plugin/test/remote-proxy-cleanup.test.ts index 07ead7e58ed..1a6b42de756 100644 --- a/packages/vitest-pool-workers/test/remote-proxy-cleanup.test.ts +++ b/packages/vitest-plugin/test/remote-proxy-cleanup.test.ts @@ -11,7 +11,7 @@ test.skipIf( async ({ expect, seed, vitestRun }) => { await seed({ "vitest.config.mts": dedent` - import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; + import { cloudflareTest } from "@cloudflare/vitest-plugin"; import { defineConfig } from "vitest/config"; export default defineConfig(async () => { diff --git a/packages/vitest-pool-workers/test/snapshots.test.ts b/packages/vitest-plugin/test/snapshots.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/snapshots.test.ts rename to packages/vitest-plugin/test/snapshots.test.ts diff --git a/packages/vitest-pool-workers/test/streaming-tails.test.ts b/packages/vitest-plugin/test/streaming-tails.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/streaming-tails.test.ts rename to packages/vitest-plugin/test/streaming-tails.test.ts diff --git a/packages/vitest-pool-workers/test/structured-logs.test.ts b/packages/vitest-plugin/test/structured-logs.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/structured-logs.test.ts rename to packages/vitest-plugin/test/structured-logs.test.ts diff --git a/packages/vitest-pool-workers/test/unhandled-rejection.test.ts b/packages/vitest-plugin/test/unhandled-rejection.test.ts similarity index 93% rename from packages/vitest-pool-workers/test/unhandled-rejection.test.ts rename to packages/vitest-plugin/test/unhandled-rejection.test.ts index 95244d926f5..349abdc5dd4 100644 --- a/packages/vitest-pool-workers/test/unhandled-rejection.test.ts +++ b/packages/vitest-plugin/test/unhandled-rejection.test.ts @@ -17,7 +17,7 @@ test( async ({ expect, seed, vitestRun }) => { await seed({ "vitest.config.mts": dedent` - import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; + import { cloudflareTest } from "@cloudflare/vitest-plugin"; export default { plugins: [cloudflareTest({ miniflare: { compatibilityDate: "2025-12-02", compatibilityFlags: ["nodejs_compat"] } })], test: { testTimeout: 30_000 } @@ -38,7 +38,7 @@ test( async ({ expect, seed, vitestRun }) => { await seed({ "vitest.config.mts": dedent` - import { cloudflareTest } from "@cloudflare/vitest-pool-workers"; + import { cloudflareTest } from "@cloudflare/vitest-plugin"; export default { plugins: [cloudflareTest({ miniflare: { compatibilityDate: "2025-12-02", compatibilityFlags: ["nodejs_compat"] } })], test: { diff --git a/packages/vitest-pool-workers/test/validation.test.ts b/packages/vitest-plugin/test/validation.test.ts similarity index 97% rename from packages/vitest-pool-workers/test/validation.test.ts rename to packages/vitest-plugin/test/validation.test.ts index 3d3e1c19655..9655d7a9008 100644 --- a/packages/vitest-pool-workers/test/validation.test.ts +++ b/packages/vitest-plugin/test/validation.test.ts @@ -169,7 +169,7 @@ test( result = await vitestRun(); expect(await result.exitCode).toBe(1); expected = dedent` - ${path.join(tmpPathName, "index.ts")} does not export a default entrypoint. \`@cloudflare/vitest-pool-workers\` does not support service workers or named entrypoints for \`SELF\`. + ${path.join(tmpPathName, "index.ts")} does not export a default entrypoint. \`@cloudflare/vitest-plugin\` does not support service workers or named entrypoints for \`SELF\`. If you're using service workers, please migrate to the modules format: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ `; expect(result.stderr).toMatch(expected); @@ -196,7 +196,7 @@ describe("coverage provider validation", () => { const result = await vitestRun(); expect(await result.exitCode).toBe(1); expect(result.stderr).toMatch( - 'Coverage provider "v8" is not supported by `@cloudflare/vitest-pool-workers`' + 'Coverage provider "v8" is not supported by `@cloudflare/vitest-plugin`' ); expect(result.stderr).toMatch("Use Istanbul instead"); } @@ -219,7 +219,7 @@ describe("coverage provider validation", () => { const result = await vitestRun(); expect(await result.exitCode).toBe(1); expect(result.stderr).toMatch( - 'Coverage provider "v8" is not supported by `@cloudflare/vitest-pool-workers`' + 'Coverage provider "v8" is not supported by `@cloudflare/vitest-plugin`' ); } ); diff --git a/packages/vitest-pool-workers/test/wait-until-timeout.test.ts b/packages/vitest-plugin/test/wait-until-timeout.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/wait-until-timeout.test.ts rename to packages/vitest-plugin/test/wait-until-timeout.test.ts diff --git a/packages/vitest-pool-workers/test/watch.test.ts b/packages/vitest-plugin/test/watch.test.ts similarity index 100% rename from packages/vitest-pool-workers/test/watch.test.ts rename to packages/vitest-plugin/test/watch.test.ts diff --git a/packages/vitest-pool-workers/tsconfig.json b/packages/vitest-plugin/tsconfig.json similarity index 100% rename from packages/vitest-pool-workers/tsconfig.json rename to packages/vitest-plugin/tsconfig.json diff --git a/packages/vitest-pool-workers/tsdown.config.ts b/packages/vitest-plugin/tsdown.config.ts similarity index 94% rename from packages/vitest-pool-workers/tsdown.config.ts rename to packages/vitest-plugin/tsdown.config.ts index f04e98c0072..041ef94ad8d 100644 --- a/packages/vitest-pool-workers/tsdown.config.ts +++ b/packages/vitest-plugin/tsdown.config.ts @@ -94,7 +94,15 @@ export default defineConfig(async () => { // Codemods — standalone jscodeshift-compatible transforms { ...commonOptions, - entry: path.join(pkgRoot, "src", "codemods", "vitest-v3-to-v4.ts"), + entry: [ + path.join(pkgRoot, "src", "codemods", "vitest-v3-to-v4.ts"), + path.join( + pkgRoot, + "src", + "codemods", + "vitest-pool-workers-to-vitest-plugin.ts" + ), + ], outDir: path.join(pkgRoot, "dist", "codemods"), dts: false, // Codemods run in the user's Node.js environment via jscodeshift, diff --git a/packages/vitest-pool-workers/turbo.json b/packages/vitest-plugin/turbo.json similarity index 100% rename from packages/vitest-pool-workers/turbo.json rename to packages/vitest-plugin/turbo.json diff --git a/packages/vitest-pool-workers/types/cloudflare-test.d.ts b/packages/vitest-plugin/types/cloudflare-test.d.ts similarity index 99% rename from packages/vitest-pool-workers/types/cloudflare-test.d.ts rename to packages/vitest-plugin/types/cloudflare-test.d.ts index d0570123ab3..18595f8e361 100644 --- a/packages/vitest-pool-workers/types/cloudflare-test.d.ts +++ b/packages/vitest-plugin/types/cloudflare-test.d.ts @@ -181,7 +181,7 @@ declare module "cloudflare:test" { * Applies all un-applied `migrations` to database `db`, recording migrations * state in the `migrationsTableName` table. `migrationsTableName` defaults to * `d1_migrations`. Call the `readD1Migrations()` function from the - * `@cloudflare/vitest-pool-workers/config` package inside Node.js to get the + * `@cloudflare/vitest-plugin/config` package inside Node.js to get the * `migrations` array. */ export function applyD1Migrations( diff --git a/packages/vitest-pool-workers/types/tsconfig.json b/packages/vitest-plugin/types/tsconfig.json similarity index 100% rename from packages/vitest-pool-workers/types/tsconfig.json rename to packages/vitest-plugin/types/tsconfig.json diff --git a/packages/vitest-pool-workers/vitest-pool-workers.svg b/packages/vitest-plugin/vitest-plugin.svg similarity index 100% rename from packages/vitest-pool-workers/vitest-pool-workers.svg rename to packages/vitest-plugin/vitest-plugin.svg diff --git a/packages/vitest-pool-workers/vitest.config.mts b/packages/vitest-plugin/vitest.config.mts similarity index 100% rename from packages/vitest-pool-workers/vitest.config.mts rename to packages/vitest-plugin/vitest.config.mts diff --git a/packages/vitest-pool-workers/test/README.md b/packages/vitest-pool-workers/test/README.md deleted file mode 100644 index f098f75dc9b..00000000000 --- a/packages/vitest-pool-workers/test/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# `@cloudflare/vitest-pool-workers` E2E Tests - -This directory implements E2E tests for the `@cloudflare/vitest-pool-workers` package. - -`@cloudflare/vitest-pool-workers` and its local dependencies are built and then published to a mock npm registry, then installed in a temporary directory to test against. - -If possible, tests should be written in the [`fixtures/vitest-pool-workers-examples`](../../../fixtures/vitest-pool-workers-examples) directory. -These tests run against `@cloudflare/vitest-pool-workers` itself, and execute much faster. -They're also a source of documentation for end users. - -Use the [`misc`](../../../fixtures/vitest-pool-workers-examples/misc) directory if your test doesn't really belong with an example. diff --git a/packages/workflows-shared/src/engine.ts b/packages/workflows-shared/src/engine.ts index a6e96855e1f..5585b888d18 100644 --- a/packages/workflows-shared/src/engine.ts +++ b/packages/workflows-shared/src/engine.ts @@ -797,7 +797,7 @@ export class Engine extends DurableObject { } // Called by the dispose function when introspecting the instance in tests - // TODO: Ideally this abort should be done by `abortAllDurableObjects` from worked called by vitest-pool-workers + // TODO: Ideally this abort should be done by `abortAllDurableObjects` from worked called by vitest-plugin async unsafeAbort(reason?: string) { await this.ctx.storage.sync(); await this.ctx.storage.deleteAll(); diff --git a/packages/wrangler/src/api/integrations/platform/index.ts b/packages/wrangler/src/api/integrations/platform/index.ts index 522193935c9..c6bd281a1f2 100644 --- a/packages/wrangler/src/api/integrations/platform/index.ts +++ b/packages/wrangler/src/api/integrations/platform/index.ts @@ -65,7 +65,7 @@ export function unstable_getDevCompatibilityDate() { * * `dev.host` is intentionally NOT consulted here: the `dev` config block is * specific to `wrangler dev` and should not influence behaviour under - * `@cloudflare/vite-plugin`, `@cloudflare/vitest-pool-workers`, or + * `@cloudflare/vite-plugin`, `@cloudflare/vitest-plugin`, or * `getPlatformProxy`. Users who need a custom `CF-Worker` host in those * environments should configure a `route` instead. */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61d21170233..7b06d68377d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,9 +216,9 @@ importers: '@cloudflare/puppeteer': specifier: ^1.0.4 version: 1.0.4 - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../../packages/vitest-pool-workers + version: link:../../packages/vitest-plugin '@types/node': specifier: 22.15.17 version: 22.15.17 @@ -1225,7 +1225,7 @@ importers: specifier: catalog:default version: 4.4.3 - fixtures/vitest-pool-workers-examples: + fixtures/vitest-plugin-examples: devDependencies: '@better-auth/stripe': specifier: ^1.4.6 @@ -1233,9 +1233,9 @@ importers: '@cloudflare/containers': specifier: ^0.2.2 version: 0.2.2 - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../../packages/vitest-pool-workers + version: link:../../packages/vitest-plugin '@cloudflare/workers-types': specifier: catalog:default version: 5.20260804.1 @@ -1259,16 +1259,16 @@ importers: version: 1.5.4(@cloudflare/workers-types@5.20260804.1)(@prisma/client@7.0.1(prisma@7.0.1(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(drizzle-orm@0.45.1(@cloudflare/workers-types@5.20260804.1)(@electric-sql/pglite@0.3.2)(@opentelemetry/api@1.9.1)(@prisma/client@7.0.1(prisma@7.0.1(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(typescript@5.8.3))(@types/pg@8.15.4)(kysely@0.28.11)(mysql2@3.15.3)(pg@8.16.3)(postgres@3.4.7)(prisma@7.0.1(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3)))(mongodb@7.1.0)(mysql2@3.15.3)(pg@8.16.3)(prisma@7.0.1(@types/react@19.2.13)(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(typescript@5.8.3))(react-dom@19.2.4(react@19.2.4))(react@19.2.4)(vitest@4.1.0) cjs-wasm-module-dep: specifier: file:./module-resolution/vendor/cjs-wasm-module-dep - version: file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep + version: file:fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep discord-api-types: specifier: 0.37.98 version: 0.37.98 esm-dep: specifier: file:./module-resolution/vendor/esm-dep - version: file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep + version: file:fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep ext-dep: specifier: file:./module-resolution/vendor/ext-dep - version: file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep + version: file:fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep jose: specifier: ^5.9.3 version: 5.9.3 @@ -1301,16 +1301,16 @@ importers: version: 4.1.0(@opentelemetry/api@1.9.1)(@types/node@22.15.17)(@vitest/ui@4.1.0)(msw@2.14.6(@types/node@22.15.17)(typescript@5.8.3))(vite@8.1.5(@types/node@22.15.17)(esbuild@0.28.1)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.1)) wasm-module-dep: specifier: file:./module-resolution/vendor/wasm-module-dep - version: file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep + version: file:fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep wrangler: specifier: workspace:* version: link:../../packages/wrangler - fixtures/vitest-pool-workers-remote-bindings: + fixtures/vitest-plugin-remote-bindings: devDependencies: - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../../packages/vitest-pool-workers + version: link:../../packages/vitest-plugin typescript: specifier: catalog:default version: 5.8.3 @@ -1413,9 +1413,9 @@ importers: fixtures/worker-with-unsafe-external-plugin: devDependencies: - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../../packages/vitest-pool-workers + version: link:../../packages/vitest-plugin '@cloudflare/workers-tsconfig': specifier: workspace:* version: link:../../packages/workers-tsconfig @@ -1434,9 +1434,9 @@ importers: fixtures/workers-shared-asset-config: devDependencies: - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../../packages/vitest-pool-workers + version: link:../../packages/vitest-plugin '@cloudflare/workers-shared': specifier: workspace:* version: link:../../packages/workers-shared @@ -2090,9 +2090,9 @@ importers: packages/edge-preview-authenticated-proxy: devDependencies: - '@cloudflare/vitest-pool-workers': + '@cloudflare/vitest-plugin': specifier: workspace:* - version: link:../vitest-pool-workers + version: link:../vitest-plugin '@cloudflare/workers-types': specifier: catalog:default version: 5.20260804.1 @@ -4025,7 +4025,7 @@ importers: specifier: workspace:* version: link:../../../wrangler - packages/vitest-pool-workers: + packages/vitest-plugin: dependencies: cjs-module-lexer: specifier: 1.2.3 @@ -4069,7 +4069,7 @@ importers: version: 22.15.17 '@types/semver': specifier: ^7.5.1 - version: 7.5.1 + version: 7.7.1 '@vitest/runner': specifier: catalog:default version: 4.1.0 @@ -4093,7 +4093,7 @@ importers: version: 17.3.0 semver: specifier: ^7.7.1 - version: 7.7.1 + version: 7.8.5 tree-kill: specifier: catalog:default version: 1.2.2 @@ -5586,7 +5586,7 @@ packages: react: ^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0 '@cloudflare/containers@0.2.2': - resolution: {integrity: sha512-cfTSd7M96Z9NeCiaN4i3FuMb+i2Nzi0HbMuxvMAnUmkXwtWIZCQ3XLqUWQkdCKWNJZ/3BLMInC6ntFvpbTWIpA==} + resolution: {integrity: sha512-cfTSd7M96Z9NeCiaN4i3FuMb+i2Nzi0HbMuxvMAnUmkXwtWIZCQ3XLqUWQkdCKWNJZ/3BLMInC6ntFvpbTWIpA==, tarball: https://registry.npmjs.org/@cloudflare/containers/-/containers-0.2.2.tgz} '@cloudflare/elements@3.0.3': resolution: {integrity: sha512-s6Sjh+IWJD0xn+4iy6hk/FYwY1gAFLWvpiWUmfDZWrQ09ZOTto8aRwpoEN7jUV6dZCPlCkUqMj4xKwRzDQ72FQ==} @@ -5809,10 +5809,10 @@ packages: react-dom: ^17.0.2 || ^18.2.21 '@cloudflare/workers-types@4.20260702.1': - resolution: {integrity: sha512-mOhf5TUEB1m2vPrxtqoIGfz0fUC9xyxRDx5gWHy5s+OCo6dcV+g7wI1R7gYCMFohhqF/2y2xeKVwMwCJjfn/WA==} + resolution: {integrity: sha512-mOhf5TUEB1m2vPrxtqoIGfz0fUC9xyxRDx5gWHy5s+OCo6dcV+g7wI1R7gYCMFohhqF/2y2xeKVwMwCJjfn/WA==, tarball: https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20260702.1.tgz} '@cloudflare/workers-types@5.20260804.1': - resolution: {integrity: sha512-B1dwxpN6e5RZXZkE5zpZj+ooNeNZ1mwavLIyHDYe10ojhlGTwDfe8sAl7R1mMXc1cyIsbr+jKVdvmMEyVcdTdg==} + resolution: {integrity: sha512-B1dwxpN6e5RZXZkE5zpZj+ooNeNZ1mwavLIyHDYe10ojhlGTwDfe8sAl7R1mMXc1cyIsbr+jKVdvmMEyVcdTdg==, tarball: https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-5.20260804.1.tgz} '@codemirror/autocomplete@6.20.0': resolution: {integrity: sha512-bOwvTOIJcG5FVo5gUUupiwYh8MioPLQ4UcqbcRf7UQ98X90tCa9E1kZ3Z7tqwpZxYyOvh1YTYbmZE9RTfTp5hg==} @@ -7515,10 +7515,6 @@ packages: resolution: {integrity: sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A==} engines: {node: '>=14'} - '@opentelemetry/api@1.7.0': - resolution: {integrity: sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==} - engines: {node: '>=8.0.0'} - '@opentelemetry/api@1.9.1': resolution: {integrity: sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==} engines: {node: '>=8.0.0'} @@ -10624,8 +10620,8 @@ packages: cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} - cjs-wasm-module-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep: - resolution: {directory: fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep, type: directory} + cjs-wasm-module-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep: + resolution: {directory: fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep, type: directory} cli-cursor@4.0.0: resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} @@ -11518,8 +11514,8 @@ packages: jiti: optional: true - esm-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep: - resolution: {directory: fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep, type: directory} + esm-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep: + resolution: {directory: fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep, type: directory} espree@10.4.0: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} @@ -11615,8 +11611,8 @@ packages: exsolve@1.0.8: resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} - ext-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep: - resolution: {directory: fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep, type: directory} + ext-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep: + resolution: {directory: fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep, type: directory} extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -14605,11 +14601,6 @@ packages: engines: {node: '>=10'} hasBin: true - semver@7.8.2: - resolution: {integrity: sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==} - engines: {node: '>=10'} - hasBin: true - semver@7.8.5: resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} engines: {node: '>=10'} @@ -15826,8 +15817,8 @@ packages: warning@4.0.3: resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==} - wasm-module-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep: - resolution: {directory: fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep, type: directory} + wasm-module-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep: + resolution: {directory: fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep, type: directory} web-streams-polyfill@4.0.0-beta.3: resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==} @@ -17069,7 +17060,7 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.7.3 + semver: 7.8.5 '@changesets/assemble-release-plan@6.0.9': dependencies: @@ -17078,7 +17069,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - semver: 7.7.3 + semver: 7.8.5 '@changesets/changelog-git@0.2.1': dependencies: @@ -17144,7 +17135,7 @@ snapshots: '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 picocolors: 1.1.1 - semver: 7.7.3 + semver: 7.8.5 '@changesets/get-github-info@0.6.0(encoding@0.1.13)': dependencies: @@ -18953,9 +18944,7 @@ snapshots: '@opentelemetry/api-logs@0.52.1': dependencies: - '@opentelemetry/api': 1.7.0 - - '@opentelemetry/api@1.7.0': {} + '@opentelemetry/api': 1.9.1 '@opentelemetry/api@1.9.1': {} @@ -19355,7 +19344,7 @@ snapshots: extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.5.0 - semver: 7.7.3 + semver: 7.8.5 tar-fs: 3.1.0 unbzip2-stream: 1.4.3 yargs: 17.7.2 @@ -21967,7 +21956,7 @@ snapshots: cjs-module-lexer@1.2.3: {} - cjs-wasm-module-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/cjs-wasm-module-dep: {} + cjs-wasm-module-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/cjs-wasm-module-dep: {} cli-cursor@4.0.0: dependencies: @@ -22932,7 +22921,7 @@ snapshots: transitivePeerDependencies: - supports-color - esm-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/esm-dep: {} + esm-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/esm-dep: {} espree@10.4.0: dependencies: @@ -23095,7 +23084,7 @@ snapshots: exsolve@1.0.8: {} - ext-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/ext-dep: {} + ext-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/ext-dep: {} extend@3.0.2: {} @@ -24129,7 +24118,7 @@ snapshots: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.8.2 + semver: 7.8.5 jsprim@2.0.2: dependencies: @@ -24519,7 +24508,7 @@ snapshots: pkg-types: 1.3.1 postcss: 8.5.14 postcss-nested: 7.0.2(postcss@8.5.14) - semver: 7.8.2 + semver: 7.8.5 tinyglobby: 0.2.17 optionalDependencies: typescript: 5.8.3 @@ -24969,7 +24958,7 @@ snapshots: ky: 1.7.5 registry-auth-token: 5.0.2 registry-url: 6.0.1 - semver: 7.7.3 + semver: 7.8.5 package-manager-detector@0.2.9: {} @@ -26197,7 +26186,7 @@ snapshots: sembear@0.7.0: dependencies: - semver: 7.7.3 + semver: 7.8.5 semiver@1.1.0: {} @@ -26215,8 +26204,6 @@ snapshots: semver@7.7.3: {} - semver@7.8.2: {} - semver@7.8.5: {} send@0.19.0: @@ -27797,7 +27784,7 @@ snapshots: dependencies: loose-envify: 1.4.0 - wasm-module-dep@file:fixtures/vitest-pool-workers-examples/module-resolution/vendor/wasm-module-dep: {} + wasm-module-dep@file:fixtures/vitest-plugin-examples/module-resolution/vendor/wasm-module-dep: {} web-streams-polyfill@4.0.0-beta.3: {} diff --git a/tools/deployments/__tests__/validate-changesets.test.ts b/tools/deployments/__tests__/validate-changesets.test.ts index 5279e1b9372..71dd11317c3 100644 --- a/tools/deployments/__tests__/validate-changesets.test.ts +++ b/tools/deployments/__tests__/validate-changesets.test.ts @@ -43,7 +43,7 @@ describe("findPackageNames()", () => { "@cloudflare/turbo-r2-archive", "@cloudflare/unenv-preset", "@cloudflare/vite-plugin", - "@cloudflare/vitest-pool-workers", + "@cloudflare/vitest-plugin", "@cloudflare/workers-auth", "@cloudflare/workers-editor-shared", "@cloudflare/workers-playground", @@ -195,11 +195,10 @@ describe("validateChangesets()", () => { expect(errors).toMatchInlineSnapshot(`[]`); }); - it("should report errors for major bumps except Miniflare prereleases", ({ - expect, - }) => { + it("should report errors for disallowed major bumps", ({ expect }) => { const errors = validateChangesets( new Map([ + ["@cloudflare/vitest-plugin", { name: "@cloudflare/vitest-plugin" }], [ "miniflare", { @@ -211,6 +210,15 @@ describe("validateChangesets()", () => { ["package-c", { name: "package-c" }], ]), [ + { + file: "major-vitest-plugin.md", + contents: dedent` + --- + "@cloudflare/vitest-plugin": major + --- + + Release v1`, + }, { file: "major-one.md", contents: dedent` diff --git a/tools/deployments/validate-changesets.ts b/tools/deployments/validate-changesets.ts index e06cabf9eef..5452769ed14 100644 --- a/tools/deployments/validate-changesets.ts +++ b/tools/deployments/validate-changesets.ts @@ -34,6 +34,7 @@ export function validateChangesets( if ( release.type === "major" && targetPackage?.private !== true && + release.name !== "@cloudflare/vitest-plugin" && (release.name !== "miniflare" || targetPackage?.["workers-sdk"]?.npmPrereleaseIdentifier === undefined)