-
Notifications
You must be signed in to change notification settings - Fork 109
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
TypeError: Cannot read property 'startsWith' of undefined at Coverage.hasNoOutput #341
Comments
I have the same issue. Have you found a solution or workaround yet? |
I got rid of this error by setting instrumentation to false:
But no tests execute, Chrome opens an empty page, with just a green header:
I tried to add the
but no luck. |
I also have this problem. An initial investigation by stepping through the code reveals that this occurs when the typescript compile-host for some reason do not call the |
Hm. For me it got fixed by setting Hopefully this can help someone else either work around the issue, or figure out the root problem :) |
Do you have any exlusions set within coverageOptions? I get the error too, but only if I use the exlude option. |
So I just realized I forgot to exclude the |
I have the same error. Hope someone can fix it. |
Has karma-typescript been broken in this way for 2 years without any resolution? I hit the same dead end after starting up a brand new repo with just one React component and trying to follow the basics of using karma-jasmine karma-typescript jasmine-enzyme and battled with it for hours in various ways - never functioned to load and run my single React component test and was always running 0 of 0 tests. As a workaround I started with https://github.com/medington/jasmine-enzyme-ts (thanks @medington) which was a proof-of-concept repro of a working Jasmine+Enzyme+Karma test suite. Unfortunately things have moved on since then and it doesn't work out of the box - unpinned packages at their latest versions break it. However, I fixed it up so that the Enzyme tests pass by updating it to all the latest packages, and tweaking here and there. You can see the changes at cefn/jasmine-enzyme-ts@9003027 At the time of writing the repo at https://github.com/cefn/jasmine-enzyme-ts now runs two Enzyme tests written in Typescript correctly using Jasmine tests in a Chrome Karma instance without hitting the errors described in this issue. It uses a webpack configuration to transform the typescript rather than the prior approach I attempted based on karma-typescript which was broken. For CI and hopefully later reproduction for others I have committed pnpm-lock.yaml so installing the project with |
I've left a little investigation report in #480, which again confirmed, that this is an error message that does not contain enough information. The report also contains a little info on how to set a fitting debugging point, which files the output cannot be found for. |
I was able to fix that by ensuring that I use a tsconfig file with:
Now I am getting a |
Issue for me was |
Hi
I get 'TypeError: Cannot read property 'startsWith' of undefined at Coverage.hasNoOutput' after run karma test.
a complete log attached for more details.
log.txt
The text was updated successfully, but these errors were encountered: