Skip to content
Open
Changes from all commits
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
5 changes: 3 additions & 2 deletions src/readme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const runReadmeUsage = async (mode: InstallMode): Promise<void> => {
mode === "working-tree"
? bashSnippet.replace(/\btypegres\b/, JSON.stringify(`file:${REPO_ROOT}`))
: bashSnippet
).replace(/\bnpm install\b/, "npm install --no-audit --no-fund --prefer-offline");
).replace(/\bnpm install\b/, `npm install --no-audit --no-fund ${mode === 'working-tree' ? '--prefer-offline' : ''}`);
await execFileP("sh", ["-c", installCmd], { cwd: tmpDir });

// Compile the snippet via swc — handles stage-3 decorators that
Expand Down Expand Up @@ -119,8 +119,9 @@ const runReadmeUsage = async (mode: InstallMode): Promise<void> => {
expect(stdout).toContain("Bob Jones");
} finally {
await db.execute(sql`DROP TABLE IF EXISTS users`).catch(() => {});
fs.rmSync(tmpDir, { recursive: true, force: true });
}
// Only delete the temp dir if everything succeeded:
fs.rmSync(tmpDir, { recursive: true, force: true });
};

test(
Expand Down
Loading