When i'm runnig jest on my project i get this issue:
Test suite failed to run
c:\projects\meteoguard\src\app\dashboard\briefing-tool\shared\component\accordion\accordion.template.html:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){<ng-content></ng-content>
Seems jest tries to requires html file and parse it, and obviously it can't
Solved, I override tsconfig path in package.json, and seem it's override the whole global section and removed "__TRANSFORM_HTML__": true flag.
I put it in my config and now it works.
In later versions solution with "__TRANSFORM_HTML__": true works, but deprecated. The following is recommended way (if through package.json):
"jest": {
"globals": {
"ts-jest": {
"stringifyContentPathRegex": "\\.html$"
}
},
}
}
https://github.com/kulshekhar/ts-jest/blob/master/docs/user/config/stringifyContentPathRegex.md
Most helpful comment
Solved, I override tsconfig path in package.json, and seem it's override the whole
globalsection and removed"__TRANSFORM_HTML__": trueflag.I put it in my config and now it works.