Skip to content

Commit

Permalink
Enable coverage in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Schulte committed Dec 14, 2018
1 parent 1399d59 commit 55e00bc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ dist/
*.d.ts.map
*.js
*.js.map
test-results.xml

# Rollup
!rollup.config.js
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
customCommand: test
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-results.xml'
testResultsFiles: '$(System.DefaultWorkingDirectory)/test-results.xml'
testRunTitle: 'Test results for JavaScript'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage/'
- job: Build
pool:
vmImage: 'Ubuntu 16.04'
Expand Down
3 changes: 3 additions & 0 deletions mocha.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"reporterEnabled": "list, mocha-junit-reporter"
}
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@
"@types/node": "^10.9.4",
"chai": "^4.1.2",
"mocha": "^5.2.0",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi-reporters": "^1.1.7",
"npm-run-all": "^4.1.5",
"nyc": "^13.1.0",
"opn-cli": "^4.0.0",
"rollup": "^0.67.3",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-sourcemaps": "^0.4.2",
Expand All @@ -78,14 +81,14 @@
".ts"
],
"exclude": [
"**/*.d.ts"
],
"include": [
"lib/**/*.ts"
"coverage/**/*",
"**/*.d.ts",
"**/*.js"
],
"reporter": [
"text",
"html"
"html",
"cobertura"
],
"all": true
},
Expand All @@ -98,6 +101,7 @@
"test": "run-p test:tslint test:unit",
"test:unit": "nyc mocha",
"test:tslint": "tslint -p . -c tslint.json --exclude test/**/*.ts",
"test:coverage": "npm run test && opn coverage/index.html",
"prepack": "npm install && npm run build",
"publish-preview": "npm test && shx rm -rf dist/test && node ./.scripts/publish",
"local": "npm explore @ts-common/azure-js-dev-tools -- npm run local",
Expand Down
3 changes: 2 additions & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--require ts-node/register
--timeout 50000
--reporter list
--reporter mocha-multi-reporters
--reporter-options configFile=mocha.config.json
--colors
test/**/*.ts

0 comments on commit 55e00bc

Please sign in to comment.