Skip to content

fix(testing): prefer using tsconfig.spec.json when loading jest config in plugin#31726

Merged
FrozenPandaz merged 1 commit intomasterfrom
jest/use-spec-tsconfig-to-load-config
Jun 26, 2025
Merged

fix(testing): prefer using tsconfig.spec.json when loading jest config in plugin#31726
FrozenPandaz merged 1 commit intomasterfrom
jest/use-spec-tsconfig-to-load-config

Conversation

@leosvelperez
Copy link
Copy Markdown
Member

Current Behavior

The @nx/jest/plugin loads the Jest config file using the project's tsconfig.json file.

Expected Behavior

The @nx/jest/plugin should try to load the Jest config file using the tsconfig.spec.json file (or other common filenames also handled by the nx jest resolver). If those files don't exist, it should fall back to the project's tsconfig.json file.

Related Issue(s)

Fixes #31351

@leosvelperez leosvelperez self-assigned this Jun 25, 2025
@leosvelperez leosvelperez requested review from a team as code owners June 25, 2025 11:11
@leosvelperez leosvelperez requested a review from AgentEnder June 25, 2025 11:11
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 25, 2025

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

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 25, 2025 11:33am

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jun 25, 2025

View your CI Pipeline Execution ↗ for commit ea027d2.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 3m 34s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 19s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-25 12:32:54 UTC

@FrozenPandaz FrozenPandaz merged commit 2daa73d into master Jun 26, 2025
9 of 10 checks passed
@FrozenPandaz FrozenPandaz deleted the jest/use-spec-tsconfig-to-load-config branch June 26, 2025 14:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 2, 2025

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 Jul 2, 2025
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.

@nx/jest resolves ts paths wrong

2 participants