Skip to content

Commit 4e8eb8d

Browse files
move failsIf() helper into shared module
1 parent 582a751 commit 4e8eb8d

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
import { test } from "vitest";
2+
13
export * from "../vitest-setup";
24
export * from "./responses";
5+
6+
export function failsIf(condition: boolean) {
7+
return condition ? test.fails : test;
8+
}

packages/vite-plugin-cloudflare/playground/react-spa/__tests__/assets.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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

44
describe("react-spa", () => {
55
test("returns the correct home page", async () => {
@@ -65,7 +65,3 @@ describe("react-spa", () => {
6565
);
6666
});
6767
});
68-
69-
function failsIf(condition: boolean) {
70-
return condition ? test.fails : test;
71-
}

packages/vite-plugin-cloudflare/playground/react-spa/__tests__/experimental-headers-and-redirects/assets.spec.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFileSync, writeFileSync } from "node:fs";
22
import { join } from "node:path";
33
import { describe, expect, test, vi } from "vitest";
4-
import { isBuild, page, viteTestUrl } from "../../../__test-utils__";
4+
import { failsIf, isBuild, page, viteTestUrl } from "../../../__test-utils__";
55

66
describe(
77
"react-spa (with experimental support)",
@@ -115,7 +115,3 @@ describe("reloading the server", () => {
115115
}
116116
);
117117
});
118-
119-
function failsIf(condition: boolean) {
120-
return condition ? test.fails : test;
121-
}

0 commit comments

Comments
 (0)