-
Notifications
You must be signed in to change notification settings - Fork 129
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
add coverage tooling #152
add coverage tooling #152
Conversation
@@ -25,9 +25,15 @@ | |||
"dev": "tsx watch ./src/preview.ts", | |||
"build": "rm -rf dist && ./bin/observable.ts build", | |||
"test": "yarn test:mocha && yarn test:lint", | |||
"test:coverage": "npx c8 yarn test:mocha", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting - a combination of npx
and yarn
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npx
loads c8
, which then runs yarn test:mocha
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for more see observablehq/plot#1818
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting... what's the benefit of this over npm i c8 --save-dev
and then modifying "test:coverage": "c8 yarn test:mocha"
? or yarn add c8 --dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
benefit is we don't install c8 if we don't check coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving since it's the same as the Plot repo
This is an exact copy of what we have in Plot (with the addition of ts files from src/).
Could help to increase coverage (#86).
calling
yarn test:coverage
outputs a coverage report in text format; it also creates a report in the lcov format, which can be used to display coverage gutters, for example.Here's what the coverage looks like in text:
And the coverage gutters: