Skip to content

Commit 465a4b8

Browse files
committed
Update
1 parent 2862601 commit 465a4b8

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

integration/helpers/vite.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,7 @@ const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
2323
const root = path.resolve(__dirname, "../..");
2424
const TMP_DIR = path.join(root, ".tmp/integration");
2525

26-
export const reactRouterConfig = ({
27-
ssr,
28-
basename,
29-
prerender,
30-
appDirectory,
31-
future,
32-
routeDiscovery,
33-
}: {
34-
ssr?: boolean;
35-
basename?: string;
36-
prerender?: boolean | string[];
37-
appDirectory?: string;
38-
future?: Partial<NonNullable<Config["future"]>>;
39-
routeDiscovery?: Config["routeDiscovery"];
40-
}) => {
41-
let config: Config = {
42-
ssr,
43-
basename,
44-
prerender,
45-
appDirectory,
46-
routeDiscovery,
47-
future,
48-
};
49-
26+
export const reactRouterConfig = (config: Partial<Config>) => {
5027
return dedent`
5128
import type { Config } from "@react-router/dev/config";
5229

integration/vite-preview-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test.describe("Vite preview", () => {
1414
test("serves built app with vite preview", async ({ vitePreview, page }) => {
1515
const files: Files = async ({ port }) => ({
1616
"react-router.config.ts": reactRouterConfig({
17-
v8_viteEnvironmentApi: true,
17+
future: { v8_viteEnvironmentApi: true },
1818
}),
1919
"vite.config.ts": await viteConfig.basic({
2020
port,
@@ -97,7 +97,7 @@ test.describe("Vite preview", () => {
9797
test("handles navigation between routes", async ({ vitePreview, page }) => {
9898
const files: Files = async ({ port }) => ({
9999
"react-router.config.ts": reactRouterConfig({
100-
v8_viteEnvironmentApi: true,
100+
future: { v8_viteEnvironmentApi: true },
101101
}),
102102
"vite.config.ts": await viteConfig.basic({
103103
port,
@@ -173,7 +173,7 @@ test.describe("Vite preview", () => {
173173
test("handles loader data correctly", async ({ vitePreview, page }) => {
174174
const files: Files = async ({ port }) => ({
175175
"react-router.config.ts": reactRouterConfig({
176-
v8_viteEnvironmentApi: true,
176+
future: { v8_viteEnvironmentApi: true },
177177
}),
178178
"vite.config.ts": await viteConfig.basic({
179179
port,
@@ -247,7 +247,7 @@ test.describe("Vite preview", () => {
247247
}) => {
248248
const files: Files = async ({ port }) => ({
249249
"react-router.config.ts": reactRouterConfig({
250-
v8_viteEnvironmentApi: true,
250+
future: { v8_viteEnvironmentApi: true },
251251
}),
252252
"vite.config.ts": await viteConfig.basic({
253253
port,

0 commit comments

Comments
 (0)