Skip to content

Commit 2b6854c

Browse files
fix: ignore external urls from coverage (#1955)
1 parent 9429153 commit 2b6854c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/cold-avocados-greet.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@web/test-runner-coverage-v8": patch
3+
"@web/test-runner": patch
4+
---
5+
6+
Ignore external urls from coverage

packages/test-runner-coverage-v8/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export async function v8ToIstanbul(
5050
if (
5151
// ignore non-http protocols (for exmaple webpack://)
5252
url.protocol.startsWith('http') &&
53+
// ignore external urls
54+
url.hostname === config.hostname &&
55+
url.port === `${config.port}` &&
5356
// ignore non-files
5457
!!extname(path) &&
5558
// ignore virtual files

0 commit comments

Comments
 (0)