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

fix(testing): correctly error with jest.mock for invalid filepaths #15445

Merged

Conversation

barbados-clemens
Copy link
Contributor

@barbados-clemens barbados-clemens commented Mar 4, 2023

Current Behavior

when trying to mock a module that doesn't exit the nx jest resolver will automagically find the file

Expected Behavior

jest correctly throws an error saying the module doesn't exist

Related Issue(s)

Fixes #15312

@vercel
Copy link

vercel bot commented Mar 4, 2023

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

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2023 4:25pm

@barbados-clemens barbados-clemens changed the title fix(testing): use rootDir to resolve files with ts fix(testing): correctly error with jest.mock for invalid filepaths Apr 5, 2023
@FrozenPandaz FrozenPandaz merged commit 083f4f1 into nrwl:master Apr 6, 2023
@barbados-clemens barbados-clemens deleted the fix/jest-resolve-correct-dir branch April 6, 2023 19:20
FrozenPandaz pushed a commit that referenced this pull request Apr 11, 2023
@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 Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jest resolver resolves to wrong file
2 participants