Skip to content

Commit e91bf39

Browse files
clarify that only one tests will fail in vite dev mode
1 parent 14c7ec6 commit e91bf39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/vite-plugin-cloudflare/playground/run-worker-first/__tests__/run-worker-first.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test } from "vitest";
2-
import { isBuild, page, viteTestUrl } from "../../__test-utils__";
2+
import { failsIf, isBuild, page, viteTestUrl } from "../../__test-utils__";
33

4-
describe.skipIf(!isBuild)("run_worker_first support", () => {
4+
describe("run_worker_first support", () => {
55
test("returns the correct home page", async () => {
66
const content = await page.textContent("h1");
77
expect(content).toBe("Vite + React");
@@ -25,7 +25,9 @@ describe.skipIf(!isBuild)("run_worker_first support", () => {
2525
expect(response.status).toBe(401);
2626
});
2727

28-
test("returns UNAUTH for an admin image", async () => {
28+
// This is the only use case that is not currently supported in dev mode.
29+
// In that mode the middleware that runs the Worker is after the built-in Vite middleware that handles the assets.
30+
failsIf(!isBuild)("returns UNAUTH for an admin image", async () => {
2931
const response = await fetch(viteTestUrl + "/admin/secret.svg");
3032
expect(response.status).toBe(401);
3133
});

0 commit comments

Comments
 (0)