Config option for reporting full-stack code coverage #1201
PaulKiddle
started this conversation in
Proposal
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
Add a config option to
astro dev
and/orastro preview
that:Background & Motivation
Code coverage is a useful tool for developers to (1) ensure they have a broad automated test suite and (2) identify unreachable or otherwise unused code and branches.
Currently Astro users who want to record full-stack code coverage must:
vite
config objectThese options are not well documented and buggy (e.g.
c8
cannot record coverage when a process exits usingprocess.exit()
, so users must use middleware mode and start/stop the server programmatically; also the source maps don't quite align with the source.astro
files).(Edit: the vite istanbul plugin doesn't actually instrument inline script tags from .astro files, so further configuration is needed - I'm not actually sure how one would do this)
By providing first-party support for code coverage Astro can help developers make their code more robust and well-tested.
Goals
Example
Astro config option:
Using cli flags:
Beta Was this translation helpful? Give feedback.
All reactions