Skip to content
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

Code coverage errors when using lodash templates #2825

Open
miyasudokoro opened this issue Oct 13, 2024 · 0 comments
Open

Code coverage errors when using lodash templates #2825

miyasudokoro opened this issue Oct 13, 2024 · 0 comments

Comments

@miyasudokoro
Copy link

I am maintaining some legacy code that uses lodash templating. When code coverage gets calculated, the following error is thrown repeatedly:

TypeError: Invalid URL
    at new URL (node:internal/url:775:36)
    at v8ToIstanbul (/var/jenkins_home/workspace/(redacted)/node_modules/@web/test-runner-coverage-v8/dist/index.js:52:21)
    ....

Debugging this shows that the value of entry.url is the string "lodash.templateSources[0]" for these errors.

I believe the best resolution of this is to skip all invalid URLs after checking them via URL.canParse.

miyasudokoro pushed a commit to miyasudokoro/web that referenced this issue Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant