Skip to content

Commit

Permalink
Improve wrangler-defaults test
Browse files Browse the repository at this point in the history
  • Loading branch information
jculvey committed Jul 6, 2023
1 parent 0bc49b6 commit 4489222
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/create-cloudflare/e2e-tests/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,25 @@ describe("E2E", () => {

const runCli = async (framework: string, args: string[] = []) => {
const projectPath = join(dummyPath, "test");
const argv = [

let argv = [
projectPath,
"--type",
"webFramework",
"--framework",
framework,
"--no-deploy",
"--no-git",
...args,
];

if (args.length > 0) {
argv = [...argv, ...args];
} else {
argv = [...argv, "--no-git"];
}

// For debugging purposes, uncomment the following to see the exact
// command the test uses. You can then run this via the command line.
// console.log("COMMAND: ", `node ${["./dist/cli.js", ...argv].join(" ")}`);
console.log("COMMAND: ", `node ${["./dist/cli.js", ...argv].join(" ")}`);

const result = await execa("node", ["./dist/cli.js", ...argv], {
stderr: process.stderr,
Expand Down Expand Up @@ -119,6 +124,9 @@ describe("E2E", () => {
});

test("Hono (wrangler defaults)", async () => {
await runCli("hono", ["wrangler-defaults"]);
const { projectPath } = await runCli("hono", ["--wrangler-defaults"]);

// verify that wrangler-defaults defaults to `true` for using git
expect(join(projectPath, ".git")).toExist();
});
});

0 comments on commit 4489222

Please sign in to comment.