Skip to content

Commit

Permalink
C3: Add angular e2e coverage (#4116)
Browse files Browse the repository at this point in the history
* C3: Adding e2e tests for angular

* Fix issues with angular + pnpm

* changeset
  • Loading branch information
jculvey authored Oct 13, 2023
1 parent a08c292 commit 5ff0ca0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-penguins-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": minor
---

Replaces the "prestart" and "predeploy" scripts when using Angular to better support pnpm
4 changes: 4 additions & 0 deletions packages/create-cloudflare/e2e-tests/pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ describe.concurrent(`E2E: Web frameworks`, () => {
unsupportedPms: ["bun"],
testCommitMessage: true,
},
angular: {
expectResponseToContain: "Love Angular?",
testCommitMessage: true,
},
gatsby: {
expectResponseToContain: "Gatsby!",
unsupportedPms: ["bun"],
Expand Down
12 changes: 5 additions & 7 deletions packages/create-cloudflare/src/frameworks/angular/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ const generate = async (ctx: PagesGeneratorContext) => {
};

const configure = async (ctx: PagesGeneratorContext) => {
const cli = getFrameworkCli(ctx, false);
process.chdir(ctx.project.path);
await runCommand(`${npx} ${cli}@next analytics disable`, {
await runCommand(`${npx} ng analytics disable`, {
silent: true,
});
await addSSRAdapter();
Expand All @@ -45,14 +44,13 @@ const config: FrameworkConfig = {
packageScripts: {
process:
"node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs",
prestart: `${npm} run build:ssr && ${npm} run process`,
start:
"wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local",
predeploy: `${npm} run build:ssr && ${npm} run process`,
deploy: "wrangler pages deploy dist/cloudflare",
"pages:build": `${npm} run build:ssr && ${npm} run process`,
start: `${npm} run pages:build && wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local`,
deploy: `${npm} run pages:build && wrangler pages deploy dist/cloudflare`,
},
deployCommand: "deploy",
devCommand: "start",
testFlags: ["--routing", "--style", "sass"],
};
export default config;

Expand Down

0 comments on commit 5ff0ca0

Please sign in to comment.