Skip to content

Commit 4914bff

Browse files
committed
01/03: include "text" reporter in code coverage
1 parent ffe7aaf commit 4914bff

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

exercises/01.setup/03.problem.code-coverage/vitest.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default defineConfig({
1313
// the source files to be used during the coverage analyzis.
1414
// 💰 coverage: { include: ['src/**/*.ts'] }
1515
//
16-
// 🐨 Finally, add the `reporter` property and use the "html" reporter.
17-
// 💰 coverage: { reporter: ['html'] }
16+
// 🐨 Finally, add the `reporter` property and assign it an array
17+
// as the value. In that array, list two reporters: "text" and "html".
18+
// 💰 coverage: { reporter: ['text', 'html'] }
1819
},
1920
})

exercises/01.setup/03.solution.code-coverage/README.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ export default defineConfig({
4646
coverage: {
4747
enabled: true,
4848
include: ['src/**/*.ts'],
49-
reporter: ['html'],
49+
reporter: ['text', 'html'],
5050
},
5151
},
5252
})
5353
```
5454

55+
> I will also keep the default `'text` reporter so I can see the coverage summary in my terminal right next to the test run. You can combine as many test reporters as you need.
56+
5557
## View coverage report
5658

5759
There are multiple coverage reporters you can use to generate the coverage report, including at the same time. That is mostly so you can provide that report to other tooling to analyze.

exercises/01.setup/03.solution.code-coverage/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
coverage: {
77
enabled: true,
88
include: ['src/**/*.ts'],
9-
reporter: ['html'],
9+
reporter: ['text', 'html'],
1010
},
1111
},
1212
})

0 commit comments

Comments
 (0)