Skip to content

fix(testing): update jest ci target to forward top level args #31379

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ndcunningham
Copy link
Contributor

This pull request refactors the dependsOn configuration for Jest targets in the Nx plugin to improve flexibility and maintainability. The changes replace string-based dependencies with structured objects, ensuring better alignment with Nx's target configuration standards.

This PR updates the dependsOn configuration for Jest ciTarget to ensure that top-level args are passed on if the parent target has a dependsOn for other targets.

For example if i pass nx run-many e2e-ci -- --json --outputFile=my-test-results.json the options:

  • --json
  • --outputFile

Should be forwarded to the dependent targets.

@ndcunningham ndcunningham self-assigned this May 28, 2025
@ndcunningham ndcunningham requested a review from a team as a code owner May 28, 2025 18:05
@ndcunningham ndcunningham requested a review from JamesHenry May 28, 2025 18:05
Copy link

vercel bot commented May 28, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) May 28, 2025 6:05pm

Copy link

nx-cloud bot commented May 28, 2025

View your CI Pipeline Execution ↗ for commit d0ba8d3.

Command Status Duration Result
nx nx-release @nx/nx-source --parallel 8 --loca... ✅ Succeeded 4m 17s View ↗
nx run-many -t build-native-wasm ✅ Succeeded 1m 27s View ↗
nx run-many --target=build-native -- --target=a... ✅ Succeeded 8m 19s View ↗
nx run-many --target=build-native -- --target=a... ✅ Succeeded 4m 29s View ↗
nx run-many --target=build-native -- --target=x... ✅ Succeeded 6m 43s View ↗
nx run-many --target=build-native -- --target=a... ✅ Succeeded 6m 31s View ↗
nx run-many --target=build-native -- --target=x... ✅ Succeeded 7m 23s View ↗
nx run-many --verbose --outputStyle stream --ta... ✅ Succeeded 7m 36s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-28 18:46:02 UTC

Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx create-nx-workspace@0.0.0-pr-31379-d0ba8d3 my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-31379-d0ba8d3
Release details 📑
Published version 0.0.0-pr-31379-d0ba8d3
Triggered by @ndcunningham
Branch fix/jest-ci-target
Commit d0ba8d3
Workflow run 15307461377

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz requested a review from Copilot May 28, 2025 19:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Jest dependsOn configuration for the Nx plugin to replace string-based dependencies with structured objects, enabling the forwarding of top-level arguments.

  • Updated dependsOn arrays in the plugin and tests to use objects instead of strings.
  • Ensured that the top-level Jest target forwards arguments to dependent targets.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/jest/src/plugins/plugin.ts Updated dependsOn configuration for Jest targets using structured objects.
packages/jest/src/plugins/plugin.spec.ts Updated tests to reflect the new structured dependsOn format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant