fix(coverage): don't process coverage for blob: urls (#31035)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions

Fixes #31030.
This commit is contained in:
Shannon Poole 2025-10-21 02:59:21 -04:00 committed by GitHub
parent 568e247187
commit 0f81808c88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 0 deletions

View file

@ -441,6 +441,7 @@ fn filter_coverages(
.filter(|e| {
let is_internal = e.url.starts_with("ext:")
|| e.url.starts_with("data:")
|| e.url.starts_with("blob:")
|| e.url.ends_with("__anonymous__")
|| e.url.ends_with("$deno$test.mjs")
|| e.url.contains("/$deno$stdin.")

View file

@ -0,0 +1,6 @@
{
"tempDir": true,
"args": "test --coverage main_test.ts",
"output": "main.out",
"exitCode": 0
}

View file

@ -0,0 +1,12 @@
Check [WILDLINE]/main_test.ts
running 1 test from ./main_test.ts
test ... ok ([WILDLINE])
ok | 1 passed | 0 failed ([WILDLINE])
| File | Branch % | Line % |
| --------- | -------- | ------ |
| main.ts | 100.0 | 100.0 |
| All files | 100.0 | 100.0 |
Lcov coverage report has been generated at [WILDLINE]
HTML coverage report has been generated at [WILDLINE]

View file

@ -0,0 +1,8 @@
export async function foo() {
const { default: bar } = await import(
URL.createObjectURL(
new Blob(["export default 'bar'"], { type: "application/typescript" }),
)
);
return bar;
}

View file

@ -0,0 +1,5 @@
import { foo } from "./main.ts";
Deno.test("test", async () => {
await foo();
});