You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
I'm using Typescript Path Mapping and jest have an issue related with that. This issue causes that jest.mock doesn't import an auto-mock, imports the real one
Set up, a typescript path map and use it in a jest.mock and see that there is no automock set, the original is imported.
Basically this doesn't do the work
import{NpmStatsService}from'@shared/npm-stats/npm-stats.service';jest.mock('@shared/npm-stats/npm-stats.service');// ----> With this the NpmStatsService should be auto-mocked but doesn't :/
What is the motivation / use case for changing the behavior?
Typescript paths maps allows you to have a more maintainable code and if you have unit test, you can not use it 😞
Environment
Nest version: 6.1.1 -> The latest
For Tooling issues:
- Node version: 10.15
- Platform: Linux
Others:
jest: ^23.6.0 -> latest install by nest-cli
ts-jest: ^23.10.5 -> latest install by nest-cli
I install the last one of jest": "^24.7.1 and ts-jest: ^24.0.2 and the problem is not there 😄.
Maybe this problem is solve by update jest and ts-jest to the latest versions
This is my package.json with the problem solved file just for the record:
I'm submitting a...
Current behavior
I'm using Typescript Path Mapping and jest have an issue related with that. This issue causes that
jest.mock
doesn't import an auto-mock, imports the real oneThis issue already solved by a merged pull-request.
I couldn't find in what version of jest that problem was solved, but I think the jest version installed by the nest cli the problem remains 😟.
Expected behavior
Have a jest version with full support of typescript path mapping
Minimal reproduction of the problem with instructions
The same exposed on the jest issue
Set up, a typescript path map and use it in a
jest.mock
and see that there is no automock set, the original is imported.Basically this doesn't do the work
What is the motivation / use case for changing the behavior?
Typescript paths maps allows you to have a more maintainable code and if you have unit test, you can not use it 😞
Environment
I install the last one of
jest": "^24.7.1
andts-jest: ^24.0.2
and the problem is not there 😄.Maybe this problem is solve by update jest and ts-jest to the latest versions
This is my package.json with the problem solved file just for the record:
The text was updated successfully, but these errors were encountered: