Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOR DISCUSSION: Mods to make nyc work properly for bedrock modules. #8

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: |
npm install
cd test
npm install
- name: Run test with Node.js ${{ matrix.node-version }}
Expand All @@ -43,3 +42,34 @@ jobs:
- run: npm install
- name: Run eslint
run: npm run lint
coverage:
needs: [test-node]
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:3.6
ports:
- 27017:27017
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: |
cd test
npm install
- name: Generate coverage report
run: |
cd test
npm run coverage-ci
env:
CI: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./test/coverage.lcov
fail_ci_if_error: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*.lcov
*.log
*.sw[nop]
*~
.nyc_output
.project
.settings
.vscode
Expand Down
13 changes: 12 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"version": "0.0.1-0",
"private": true,
"scripts": {
"test": "node --preserve-symlinks test.js test"
"test": "node --preserve-symlinks test.js test",
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary npm test",
"coverage-ci": "cross-env NODE_ENV=test nyc --reporter=text-lcov npm test > coverage.lcov",
"coverage-report": "nyc report"
},
"dependencies": {
"apisauce": "^1.1.1",
Expand All @@ -29,6 +32,14 @@
"bedrock-test": "^5.1.0",
"bedrock-validation": "^4.2.0",
"bedrock-zcap-storage": "^2.0.0",
"cross-env": "^7.0.2",
"nyc": "^15.0.1",
"sinon": "^9.0.0"
},
"nyc": {
"excludeNodeModules": false,
"include": [
"node_modules/bedrock-profile-http/**"
]
}
}