File tree 4 files changed +43
-2
lines changed
4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 66
66
cache : npm
67
67
- name : Install dependencies
68
68
run : npm ci
69
- - name : run unit tests
69
+ - name : Run unit tests
70
70
run : npm run test
71
71
72
72
build :
Original file line number Diff line number Diff line change
1
+ name : Coverage
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ artifact :
7
+ type : boolean
8
+ name :
9
+ type : string
10
+ default : coverage
11
+
12
+ jobs :
13
+ coverage :
14
+ name : Collect unit test coverage
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout repository
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Set up Node.js
21
+ uses : actions/setup-node@v4
22
+ with :
23
+ node-version-file : .nvmrc
24
+ cache : npm
25
+
26
+ - name : Install dependencies
27
+ run : npm ci
28
+
29
+ - name : Run unit tests
30
+ run : npm run test:coverage
31
+
32
+ - name : Compress coverage results into ZIP
33
+ if : ${{ inputs.artifact }}
34
+ run : cd coverage && zip -r ../coverage.zip *
35
+
36
+ - name : Upload coverage artifact
37
+ if : ${{ inputs.artifact }}
38
+ uses : actions/upload−artifact@v4
39
+ with :
40
+ name : ${{ inputs.name }}
41
+ path : coverage.zip
Original file line number Diff line number Diff line change 2
2
module . exports = {
3
3
preset : "ts-jest" ,
4
4
testEnvironment : "node" ,
5
- collectCoverage : true ,
6
5
} ;
Original file line number Diff line number Diff line change 5
5
"build" : " tsc" ,
6
6
"start" : " node ./dist/index.js" ,
7
7
"test" : " jest" ,
8
+ "test:coverage" : " jest --collectCoverage --coverageDirectory=coverage --coverageReporters=html --coverageReporters=text" ,
8
9
"lint" : " eslint src/**/* --max-warnings=0" ,
9
10
"format" : " prettier . --check"
10
11
},
You can’t perform that action at this time.
0 commit comments