Skip to content

Commit

Permalink
docs: Adds how to report coverage on test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
davelosert authored Dec 17, 2023
1 parent d8cdd10 commit 239db7e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default defineConfig({
coverage: {
// you can include other reporters, but 'json-summary' is required, json is recommended
reporter: ['text', 'json-summary', 'json'],
// If you want a coverage report even if your tests are failing, include this
reportOnFailure: true,
}
}
});
Expand Down Expand Up @@ -58,7 +60,9 @@ jobs:
- name: 'Test'
run: npx vitest --coverage
- name: 'Report Coverage'
if: always() # Also generate the report if tests are failing
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your `vitest.config.js` as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
```
Expand Down

0 comments on commit 239db7e

Please sign in to comment.