-
Notifications
You must be signed in to change notification settings - Fork 12
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
support testing with jest #10
Comments
Hello, @Julian-B90 , Could you please create a small reproduction repo or a Stackblitz ? Also, I've looked through the Jest suggestions in the error message. have you tried disabling |
Hey @sapozhnikovay i have create a git repo. I hope it helps. Wenn you run https://github.com/Julian-B90/angular-jest-reproduce-ngx-mat-datefns-date-adapter |
Thanks, Julian. I'll look into the issue and let you know. |
Julian, Right now you can include date-fns ES Module into jest transforming process via configuration.
And this into compilerOptions object in tsconfig.ts :
In the repo provided above this settings lead to successful compilation process(at first run it takes time =) and subsequent error in the test itself (lack of various imports in the configureTestingModule for the ngx-mat-datefns-date-adapter). I'll examine more thoroughly the ESM exports in the date-fns and update my package to use plain exports in a couple of days. |
@sapozhnikovay the options works thanks you. But you were right this test are now very slow. |
Fixed in version 11.2.2 |
it is possible you can import the local from
date-fns/locale
?Because we i run my JEST test i get this error:
The text was updated successfully, but these errors were encountered: