File tree Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 6666 cache : npm
6767 - name : Install dependencies
6868 run : npm ci
69- - name : run unit tests
69+ - name : Run unit tests
7070 run : npm run test
7171
7272 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 22module . exports = {
33 preset : "ts-jest" ,
44 testEnvironment : "node" ,
5- collectCoverage : true ,
65} ;
Original file line number Diff line number Diff line change 55 "build" : " tsc" ,
66 "start" : " node ./dist/index.js" ,
77 "test" : " jest" ,
8+ "test:coverage" : " jest --collectCoverage --coverageDirectory=coverage --coverageReporters=html --coverageReporters=text" ,
89 "lint" : " eslint src/**/* --max-warnings=0" ,
910 "format" : " prettier . --check"
1011 },
You can’t perform that action at this time.
0 commit comments