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 ability to split jest tests #22662

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Apr 4, 2024

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 a ciTargetName.

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 #

Copy link

vercel bot commented Apr 4, 2024

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Apr 10, 2024 2:25pm

Copy link
Member

@AgentEnder AgentEnder left a 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",
Copy link
Member

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.

@@ -96,7 +91,7 @@ export const createNodes: CreateNodes<JestPluginOptions> = [
options = normalizeOptions(options);

const hash = calculateHashForCreateNodes(projectRoot, options, context);
const targets =
const { targets } =
Copy link
Member

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

Copy link
Contributor

@Coly010 Coly010 left a 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

@FrozenPandaz FrozenPandaz merged commit fd7cf38 into nrwl:master Apr 10, 2024
6 checks passed
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 Apr 17, 2024
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

3 participants