Skip to content

Commit

Permalink
don't test commit message for hono
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Aug 21, 2023
1 parent 26333a2 commit 0d0a46b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions packages/create-cloudflare/e2e-tests/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Areas for future improvement:

type FrameworkTestConfig = RunnerConfig & {
expectResponseToContain: string;
testCommitMessage: boolean;
};

describe(`E2E: Web frameworks`, () => {
Expand Down Expand Up @@ -79,7 +80,10 @@ describe(`E2E: Web frameworks`, () => {
return { output };
};

const runCliWithDeploy = async (framework: string) => {
const runCliWithDeploy = async (
framework: string,
testCommitMessage: boolean
) => {
const { argv, overrides, promptHandlers, expectResponseToContain } =
frameworkTests[framework];

Expand Down Expand Up @@ -110,16 +114,20 @@ describe(`E2E: Web frameworks`, () => {
`(${framework}) Deployed page (${projectUrl}) didn't contain expected string: "${expectResponseToContain}"`
).toContain(expectResponseToContain);

await testDeploymentCommitMessage(getName(framework), framework);
if (testCommitMessage) {
await testDeploymentCommitMessage(getName(framework), framework);
}
};

// These are ordered based on speed and reliability for ease of debugging
const frameworkTests: Record<string, FrameworkTestConfig> = {
astro: {
expectResponseToContain: "Hello, Astronaut!",
testCommitMessage: true,
},
hono: {
expectResponseToContain: "Hello Hono!",
testCommitMessage: false,
},
qwik: {
expectResponseToContain: "Welcome to Qwik",
Expand All @@ -129,9 +137,11 @@ describe(`E2E: Web frameworks`, () => {
input: [keys.enter],
},
],
testCommitMessage: true,
},
remix: {
expectResponseToContain: "Welcome to Remix",
testCommitMessage: true,
},
next: {
expectResponseToContain: "Create Next App",
Expand All @@ -141,6 +151,7 @@ describe(`E2E: Web frameworks`, () => {
input: ["y"],
},
],
testCommitMessage: true,
},
nuxt: {
expectResponseToContain: "Welcome to Nuxt!",
Expand All @@ -149,9 +160,11 @@ describe(`E2E: Web frameworks`, () => {
build: "NITRO_PRESET=cloudflare-pages nuxt build",
},
},
testCommitMessage: true,
},
react: {
expectResponseToContain: "React App",
testCommitMessage: true,
},
solid: {
expectResponseToContain: "Hello world",
Expand All @@ -169,6 +182,7 @@ describe(`E2E: Web frameworks`, () => {
input: [keys.enter],
},
],
testCommitMessage: true,
},
svelte: {
expectResponseToContain: "SvelteKit app",
Expand All @@ -186,16 +200,18 @@ describe(`E2E: Web frameworks`, () => {
input: [keys.enter],
},
],
testCommitMessage: true,
},
vue: {
expectResponseToContain: "Vite App",
testCommitMessage: true,
},
};

test.concurrent.each(Object.keys(frameworkTests))(
"%s",
async (name) => {
await runCliWithDeploy(name);
await runCliWithDeploy(name, frameworkTests[name].testCommitMessage);
},
{ retry: 3 }
);
Expand Down

0 comments on commit 0d0a46b

Please sign in to comment.