-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 ability to split jest tests #22662
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit e081de8. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only real change request is the project-level metadata, otherwise looks good. I'd like a better description, but can't think of better phrasing so 🤷
}, | ||
], | ||
"metadata": { | ||
"description": "Run Jest Tests in CI", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this description should be a bit more... descriptive. It would be nice if it mentioned that running it prompts the split targets to be ran in some way.
packages/jest/src/plugins/plugin.ts
Outdated
@@ -96,7 +91,7 @@ export const createNodes: CreateNodes<JestPluginOptions> = [ | |||
options = normalizeOptions(options); | |||
|
|||
const hash = calculateHashForCreateNodes(projectRoot, options, context); | |||
const targets = | |||
const { targets } = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should set the project-level metadata too
9612793
to
027c05d
Compare
9ea1b5e
to
832ecc5
Compare
832ecc5
to
e081de8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch on the Remix e2e, LGTM
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. |
Current Behavior
The
@nx/jest/plugin
does not split tasks like Cypress and Playwright.Expected Behavior
The
@nx/jest/plugin
does split tasks like Cypress and Playwright. This is not enabled by default but can be enabled by configuring@nx/jest/plugin
to have aciTargetName
.This is not recommended for unit tests like jest is usually used for. If e2e tests are run via jest, like they are in the Nx repo, it can be enabled.
Related Issue(s)
Fixes #