-
Notifications
You must be signed in to change notification settings - Fork 778
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug with vitest + pages with wrangler.toml (#6911)
* infer experimentalJsonConfig from file ext * changeset
- Loading branch information
1 parent
d696850
commit 30b7328
Showing
7 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: infer experimentalJsonConfig from file extension | ||
|
||
Fixes [#5768](https://github.com/cloudflare/workers-sdk/issues/5768) - issue with vitest and Pages projects with wrangler.toml |
3 changes: 3 additions & 0 deletions
3
fixtures/vitest-pool-workers-examples/pages-with-config/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# pages-with-config | ||
|
||
Tests for regression of [#5768](https://github.com/cloudflare/workers-sdk/issues/5768) |
5 changes: 5 additions & 0 deletions
5
fixtures/vitest-pool-workers-examples/pages-with-config/pages-config.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { expect, it } from "vitest"; | ||
|
||
it("should run tests even if Pages project specifies wrangler.toml", () => { | ||
expect(1).toBe(1); | ||
}); |
4 changes: 4 additions & 0 deletions
4
fixtures/vitest-pool-workers-examples/pages-with-config/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../tsconfig.node.json", | ||
"include": ["./*.ts"] | ||
} |
11 changes: 11 additions & 0 deletions
11
fixtures/vitest-pool-workers-examples/pages-with-config/vitest.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineWorkersProject } from "@cloudflare/vitest-pool-workers/config"; | ||
|
||
export default defineWorkersProject({ | ||
test: { | ||
poolOptions: { | ||
workers: { | ||
wrangler: { configPath: "./wrangler.toml" }, | ||
}, | ||
}, | ||
}, | ||
}); |
6 changes: 6 additions & 0 deletions
6
fixtures/vitest-pool-workers-examples/pages-with-config/wrangler.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#:schema node_modules/wrangler/config-schema.json | ||
name = "pages-with-config" | ||
compatibility_date = "2024-09-19" | ||
compatibility_flags = ["nodejs_compat"] | ||
pages_build_output_dir = "public" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters