Skip to content

Commit f52d8af

Browse files
committed
tests: automatically create directories for edits
1 parent 369ce68 commit f52d8af

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

integration/helpers/fixtures.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type Edits = Record<string, string | ((contents: string) => string)>;
3131
async function applyEdits(cwd: string, edits: Edits) {
3232
const promises = Object.entries(edits).map(async ([file, transform]) => {
3333
const filepath = Path.join(cwd, file);
34+
await fs.mkdir(Path.dirname(filepath), { recursive: true });
3435
await fs.writeFile(
3536
filepath,
3637
typeof transform === "function"

integration/typegen-test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,6 @@ test.describe("typegen", () => {
338338
});
339339

340340
test("routes outside app dir", async ({ cwd, edit, $ }) => {
341-
// Create the subdirectories
342-
await fs.mkdir(Path.join(cwd, "app/router"), { recursive: true });
343-
await fs.mkdir(Path.join(cwd, "app/pages"), { recursive: true });
344-
345341
await edit({
346342
"react-router.config.ts": tsx`
347343
export default {

0 commit comments

Comments
 (0)