@@ -15,6 +15,9 @@ npm i borp --save-dev
1515
1616``` bash
1717borp --coverage
18+
19+ # with check coverage active
20+ borp --coverage --check-coverage --lines 95
1821```
1922
2023Borp will automatically run all tests files matching ` *.test.{js|ts} ` .
@@ -25,30 +28,30 @@ Borp will automatically run all tests files matching `*.test.{js|ts}`.
2528.
2629├── src
2730│ ├── lib
28- │ │ └── add .ts
31+ │ │ └── math .ts
2932│ └── test
30- │ └── add .test.ts
33+ │ └── math .test.ts
3134└── tsconfig.json
3235
3336```
3437
35- As an example, consider having a ` src/lib/add .ts ` file
38+ As an example, consider having a ` src/lib/math .ts ` file
3639
3740``` typescript
38- export function add (x : number , y : number ): number {
41+ export function math (x : number , y : number ): number {
3942 return x + y
4043}
4144```
4245
43- and a ` src/test/add .test.ts ` file:
46+ and a ` src/test/math .test.ts ` file:
4447
4548``` typescript
4649import { test } from ' node:test'
47- import { add } from ' ../lib/add .js'
50+ import { math } from ' ../lib/math .js'
4851import { strictEqual } from ' node:assert'
4952
50- test (' add ' , () => {
51- strictEqual (add (1 , 2 ), 3 )
53+ test (' math ' , () => {
54+ strictEqual (math (1 , 2 ), 3 )
5255})
5356```
5457
@@ -97,7 +100,12 @@ Note the use of `incremental: true`, which speed up compilation massively.
97100* ` --reporter ` or ` -r ` , set up a reporter, use a colon to set a file destination. Default: ` spec ` .
98101* ` --no-typescript ` or ` -T ` , disable automatic TypeScript compilation if ` tsconfig.json ` is found.
99102* ` --post-compile ` or ` -P ` , the path to a file that will be executed after each typescript compilation.
100-
103+ * ` --check-coverage ` , enables c8 check coverage; default is false
104+ ### Check coverage options
105+ * ` --lines ` , set the lines threshold when check coverage is active; default is 100
106+ * ` --functions ` , set the functions threshold when check coverage is active; default is 100
107+ * ` --statements ` , set the statements threshold when check coverage is active; default is 100
108+ * ` --branches ` , set the branches threshold when check coverage is active; default is 100
101109## Reporters
102110
103111Here are the available reporters:
0 commit comments