-
Notifications
You must be signed in to change notification settings - Fork 299
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
cannot find module 'ngx-mask' when running jest on angular 13 #962
Comments
I can reproduce this. The generated package looks different: Comparison
|
I had issue with running jest with ngx-mask ver 13 on Angular 12.1 (I think bc it doesnt contain .js files but .mjs). |
Seeing the same issue with Angular 13.0.1 and NGX-Mask 13.0.1 |
The issue is actually the absence of the file indicated in the I'm unsure if this is a problem with this library pointing to that file or if this should be something that Anyways, workaround for now is to add the following to moduleNameMapper: {
// ...
'ngx-mask': '<rootDir>/node_modules/ngx-mask/fesm2015/ngx-mask.mjs',
}, Or alternatively, this to your "paths": {
"ngx-mask": ["node_modules/ngx-mask/fesm2015/ngx-mask.mjs"]
} |
For reference: ngrx/platform#3248 |
@guilhermetod Thank you for explanation |
This should not be closed IMO as the issue still occurs. |
Same error here! 😢 |
Hi @RogierKonings @manuelmeister @kievsash @JosephBarkate @kevinmallinsonflynn @RogierKonings @thayna-oliveira Hi All. Thank you that using ngx-mask package. Yes it was couple mistakes with updating to ng13 . Issues was around paths and build config angular package system . Please try version >=14.2.1 . Everything should works as expected |
It works when you down-grade the version , i install the version 12 |
🐞 bug report
Is this a regression?
Yes, the previous version in which this bug was not present was: ....The bug does not appear in version <=12, where the unit test succeeds but throws a TypeError
Description
A clear and concise description of the problem...🔬 Minimal Reproduction
https://stackblitz.com/...Run jest on a unit-test that imports NgxMaskModule.
The test will fail and show a stacktrace
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
"jest": "27.4.5"
The text was updated successfully, but these errors were encountered: