I my working on a angular 8 project and have some trouble with TU execution.
When I run my TU with ng test I get this error:
> ng test --progress --browsers ChromeHeadless_custom
10% building 1/1 modules 0 active05 01 2022 16:01:11.191:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/
05 01 2022 16:01:11.195:INFO [launcher]: Launching browsers ChromeHeadless_custom with concurrency unlimited
05 01 2022 16:01:11.201:INFO [launcher]: Starting browser ChromeHeadless
ERROR in TypeError: Cannot read property 'lastIndexOf' of undefined
at Object.startsWith (C:\Users\e12404\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:1914:20)
at isPathRelativeToParent (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93723:23)
at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93682:24
at Object.firstDefined (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:295:26)
at getPathRelativeToRootDirs (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93680:23)
at tryGetModuleNameFromRootDirs (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93553:40)
at getLocalModuleSpecifier (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93422:44)
at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93409:96
at Array.map (<anonymous>)
at Object.getModuleSpecifiers (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:93409:57)
at getSpecifierForModuleSymbol (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35318:62)
at createExpressionFromSymbolChain (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35434:49)
at symbolToExpression (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:35429:24)
at C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34427:106
at withContext (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34456:37)
at symbolToExpression (C:\Users\v\Documents\project\lib_common\node_modules\typescript\lib\typescript.js:34427:28)
npm ERR! Test failed. See above for more details.
The project builds with no error. So maybe it's a problem in my tests.
I saw similar problems but it was about vscode typescript parser or about a typescript bug.
I have the same error with typescript@3.5.3 and typescript@4.5.0
Do you have any ideas ?