Skip to content

Commit 79c14ba

Browse files
Add GitHub Actions workflow for testing and coverage, update package.json scripts with coverage command
1 parent dc4b41f commit 79c14ba

2 files changed

Lines changed: 31 additions & 4 deletions

File tree

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v6
11+
12+
- name: Use Node.js lts/*
13+
uses: actions/setup-node@v6
14+
with:
15+
node-version: lts/*
16+
check-latest: true
17+
18+
- run: npm ci
19+
- run: npm run type-check
20+
- run: npm run coverage
21+
22+
- uses: coverallsapp/github-action@master
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- run: npm run build

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"author": "Andrey Helldar <helldar@dragon-code.pro>",
55
"main": "./dist/index.js",
66
"scripts": {
7-
"type-check": "tsc --noEmit",
8-
"test": "jest",
9-
"dev": "npm run build && node dist/index.js",
107
"build": "ncc build ./src/index.ts",
11-
"release": "npm run build"
8+
"release": "npm run build",
9+
"dev": "npm run build && node dist/index.js",
10+
"coverage": "jest --coverage",
11+
"test": "jest",
12+
"type-check": "tsc --noEmit"
1213
},
1314
"keywords": [
1415
"preview",

0 commit comments

Comments
 (0)