Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testing): add static serve target for e2e tests in CI #15808

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Mar 21, 2023

This PR adds serve-static targets when generating apps using @nrwl/angular:app and @nrwl/react:app.

When the Cypress project is configured, it will find the serve-static target and add the following:

e2e: {
    //...
  configuration: {
    //...
    ci: {
        devServerTarget: `<app-name>:serve-static`,
    }
  }
}

The user can then run nx e2e <e2e-name> --configuration=ci in their CI so the built app (which might be cached already) to speed up jobs.

Example

nx g @nrwl/angular:app my-app

# Run normally with dev-server (good for development)
nx e2e my-app-e2e

# Run with static server (good for CI)
nx e2e my-app-e2e --configuration=ci 

Note

The serve-static and --configuration=ci will be generated when using npx create-nx-workspace as well.

@vercel
Copy link

vercel bot commented Mar 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
nx-dev ⬜️ Ignored (Inspect) Mar 22, 2023 at 6:31PM (UTC)

@jaysoo jaysoo enabled auto-merge (squash) March 22, 2023 18:43
@jaysoo jaysoo merged commit b124b97 into nrwl:master Mar 22, 2023
@jaysoo jaysoo deleted the feat/cypress-serve-static branch March 22, 2023 18:54
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants