Install nyc and Coveralls

This commit is contained in:
Mimi 2021-04-11 10:48:56 +08:00
parent a66b93036c
commit d624041eca
3 changed files with 15 additions and 2 deletions

View File

@ -9,6 +9,15 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v2
- run: npm install - name: Install Dependencies
run: npm install
- run: npm run eslint - run: npm run eslint
- run: npm test - run: npm test
- name: Coverage
run: npm run test-cov
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
yarn.lock yarn.lock
package-lock.json package-lock.json
node_modules/ node_modules/
.nyc_output/
coverage/

View File

@ -16,7 +16,8 @@
"eslint": "eslint scripts/ source/js test/", "eslint": "eslint scripts/ source/js test/",
"prepare": "node .githooks/install.js", "prepare": "node .githooks/install.js",
"stylint": "stylint source/css/", "stylint": "stylint source/css/",
"test": "mocha test/index.js" "test": "mocha test/index.js",
"test-cov": "nyc --reporter=lcovonly npm run test"
}, },
"repository": "next-theme/hexo-theme-next", "repository": "next-theme/hexo-theme-next",
"keywords": [ "keywords": [
@ -38,6 +39,7 @@
"hexo-renderer-marked": "4.0.0", "hexo-renderer-marked": "4.0.0",
"js-yaml": "4.0.0", "js-yaml": "4.0.0",
"mocha": "8.3.2", "mocha": "8.3.2",
"nyc": "15.1.0",
"stylint": "2.0.0" "stylint": "2.0.0"
} }
} }