Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions integration/typegen-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import fs from "node:fs/promises";

import { expect } from "@playwright/test";
import tsx from "dedent";
import * as Path from "pathe";

Expand Down Expand Up @@ -337,7 +336,7 @@ test.describe("typegen", () => {
await $("pnpm typecheck");
});

test("routes outside app dir", async ({ cwd, edit, $ }) => {
test("routes outside app dir", async ({ edit, $ }) => {
await edit({
"react-router.config.ts": tsx`
export default {
Expand Down Expand Up @@ -374,14 +373,6 @@ test.describe("typegen", () => {
`,
});
await $("pnpm typecheck");

// Verify that the types file was generated in the correct location
const annotationPath = Path.join(
cwd,
".react-router/types/app/pages/+types/product.ts",
);
const annotation = await fs.readFile(annotationPath, "utf8");
expect(annotation).toContain("export namespace Route");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can you be sure .react-router/types/app/pages/+types/product.ts exists without the assertion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that file doesn't exist, then pnpm typecheck will fail

});

test("matches", async ({ edit, $ }) => {
Expand Down