Skip to content

Commit

Permalink
chore(crwa): update e2e test to handle yarn install patch (#9862)
Browse files Browse the repository at this point in the history
This PR fixes the CRWA e2e tests after the functionality introduced in
#9861.

For now I'm skipping `yarn install` since it's prone to timeouts in CI,
and the subsequent step, generating types, is also flakey since `yarn
pack` seems to skip the `.yarnrc.yml` which is necessary for configuring
a proper install.
  • Loading branch information
jtoar committed Jan 24, 2024
1 parent 803d23a commit e1848ba
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions packages/create-redwood-app/tests/e2e.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ describe('crwa', () => {
})

test('--yes, -y', async () => {
const p = await $`yarn create-redwood-app ./redwood-app --yes`
// Running `yarn install` in Jest test times out and the subsequent step,
// generating types, is also flakey since `yarn pack` seems to skip `.yarnrc.yml`
// which is necessary for configuring a proper install.
const p =
await $`yarn create-redwood-app ./redwood-app --no-yarn-install --yes`

// await $`yarn create-redwood-app redwood-app -y`
// # `yarn pack` seems to ignore `.yarnrc.yml`
Expand All @@ -75,10 +79,11 @@ describe('crwa', () => {
[?25h✔ Creating your Redwood app in ./redwood-app based on command line argument
✔ Using TypeScript based on command line flag
✔ Will initialize a git repo based on command line flag
✔ Will run yarn install based on command line flag
✔ Will not run yarn install based on command line flag
[?25l⠋ Creating project files
[?25h[?25l✔ Project files created
[?25h[?25l⠋ Initializing a git repo
[?25hℹ Skipped yarn install step
[?25l⠋ Initializing a git repo
[?25h[?25l✔ Initialized a git repo with commit message "Initial commit"
[?25h
Thanks for trying out Redwood!
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/tests/e2e_prompts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $projectPath

set projectDirectory "redwood-app-prompt-test"

spawn yarn create-redwood-app
spawn yarn create-redwood-app --no-yarn-install

expect "Where would you like to create your Redwood app?"
send "$projectDirectory\n"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/tests/e2e_prompts_git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $projectPath

set projectDirectory "redwood-app-prompt-git-test"

spawn yarn create-redwood-app --git
spawn yarn create-redwood-app --no-yarn-install --git

expect "Where would you like to create your Redwood app?"
send "$projectDirectory\n"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/tests/e2e_prompts_m.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $projectPath

set projectDirectory "redwood-app-prompt-m-test"

spawn yarn create-redwood-app -m "first"
spawn yarn create-redwood-app --no-yarn-install -m "first"

expect "Where would you like to create your Redwood app?"
send "$projectDirectory\n"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/tests/e2e_prompts_overwrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set projectDirectory "redwood-app-prompt-overwrite-test"
exec mkdir $projectDirectory
exec touch $projectDirectory/README.md

spawn yarn create-redwood-app
spawn yarn create-redwood-app --no-yarn-install

expect "Where would you like to create your Redwood app?"
send "$projectDirectory\n"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-redwood-app/tests/e2e_prompts_ts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $projectPath

set projectDirectory "redwood-app-prompt-ts-test"

spawn yarn create-redwood-app --ts
spawn yarn create-redwood-app --no-yarn-install --ts

expect "Where would you like to create your Redwood app?"
send "$projectDirectory\n"
Expand Down

0 comments on commit e1848ba

Please sign in to comment.