Closed skyleguy closed 3 years ago
Hi, you have a mistake in your jest config. Starting from v9.0.0, we introduced a Jest transformer which invokes ts-jest
so your transform
config should be
transform: {
"^.+\\.(ts|html)$": "jest-preset-angular", // put `jest-preset-angular` instead of `ts-jest`
"^.+\\.js$": "babel-jest"
},
🐛 Bug Report
I am trying to use the @microsoft/mgt libraries in my default angular 12 project but I have run into several issues with jest and these libraries. I have seen the typical issues with import/export and an error with lit-html (dependency of @microsoft/mgt-components) cannot use import statement outside of a module. I think that i have finally resolved all of these by using transform and transformIgnorePatterns issues but am now facing this issue:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect that the app component specs successfully complete 100%.
Link to repo (highly encouraged)
https://github.com/skyleguy/angular12-jest-mgt-toolkit-example.git
Error log:
envinfo
node: v14.17.3 npm: 6.14.13