deno/cli/tools/coverage
Christian Svensson 5ddbb36d3f
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 wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
feat(coverage): add dark-mode to HTML coverage report (#29267)
This PR adds `color-scheme: light dark` support for the HTML coverage
report. It uses `light-dark(#fff, #000)` to provide colors for each
color scheme.

- There's been [one other change to `coverage/style.css` file
before](66185e0d1d),
so is it fine to to change this file more or should this file stay close
to Istanbul original code?
- I don't think there's any existing tests for the styles, so I could
not see any easy way to add unit tests for these changes
- IMO these changes work without a theme toggle, but I could try adding
one [with some `<head>`
script](https://github.com/denoland/deno/blob/main/cli/tools/coverage/reporter.rs/#L533)
and a button in the navbar if required to land this PR


## Screenshots

<details>
<summary><strong>Coverage summary</strong></summary>

### Before


![image](https://github.com/user-attachments/assets/0a8a9fa7-e597-4ede-baef-4daeef93d237)

### After


![image](https://github.com/user-attachments/assets/6c76ee19-3df1-460d-b191-941cdb26017b)

</details>

<details>
<summary><strong>File coverage<strong></summary>

### Before


![image](https://github.com/user-attachments/assets/8062280a-4209-4ad3-b931-c4816b30881f)

### After


![image](https://github.com/user-attachments/assets/5fcd7a22-549f-4d93-97ab-071224e45e42)

</details>

Closes #29266
2025-05-12 19:37:03 +02:00
..
ignore_directives.rs feat(coverage): add coverage ignore comments (#26590) 2025-04-15 17:56:55 +00:00
merge.rs chore: update to rust 1.85 (#28236) 2025-02-25 08:50:01 -08:00
mod.rs fix(coverage): don't panic if all covered files are ignored via directive (#29250) 2025-05-12 02:47:32 +02:00
range_tree.rs chore: update to rust 1.85 (#28236) 2025-02-25 08:50:01 -08:00
reporter.rs fix(coverage): don't panic if all covered files are ignored via directive (#29250) 2025-05-12 02:47:32 +02:00
style.css feat(coverage): add dark-mode to HTML coverage report (#29267) 2025-05-12 19:37:03 +02:00
util.rs chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00