Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

347
Visualizações
Why I have a typescript error when I run my TU?

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.

See console output

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 ?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda