Skip to content

Commit

Permalink
C3: fixing e2e test run
Browse files Browse the repository at this point in the history
  • Loading branch information
jculvey committed Jul 18, 2023
1 parent 6409c90 commit 3fbaa4a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/create-cloudflare/e2e-tests/pages.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { existsSync, rmSync } from "fs";
import { existsSync, mkdtempSync, realpathSync, rmSync } from "fs";
import { tmpdir } from "os";
import { join } from "path";
import { FrameworkMap } from "frameworks/index";
Expand All @@ -14,16 +14,18 @@ Areas for future improvement:
*/

describe("E2E", () => {
let basePath: string;
let projectPath: string;

beforeEach(() => {
projectPath = join(tmpdir(), "c3-test-pages");
basePath = realpathSync(mkdtempSync(tmpdir()));
projectPath = join(basePath, "c3-test-pages");
rmSync(projectPath, { recursive: true, force: true });
});

afterEach(() => {
if (existsSync(projectPath)) {
rmSync(projectPath, { recursive: true });
if (existsSync(basePath)) {
rmSync(basePath, { recursive: true });
}
});

Expand All @@ -41,7 +43,7 @@ describe("E2E", () => {
];

if (argv.length > 0) {
args.push(...args);
args.push(...argv);
} else {
args.push("--no-git");
}
Expand Down

0 comments on commit 3fbaa4a

Please sign in to comment.