Skip to content
This repository was archived by the owner on May 22, 2019. It is now read-only.

Commit 5d7f68a

Browse files
committed
add test coverage and publish test results and coverage in Azure Pipelines
1 parent d067a5c commit 5d7f68a

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7+
test-report.xml
78

89
# Runtime data
910
pids

azure-pipelines.yml

+8
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ steps:
2626
npm run build
2727
npm test
2828
displayName: 'npm install, build and test'
29+
30+
- task: PublishTestResults@2
31+
inputs:
32+
testResultsFiles: '**/test-report.xml'
33+
34+
- task: PublishCodeCoverageResults@1
35+
inputs:
36+
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/clover.xml

jestconfig.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
"^.+\\.(t|j)sx?$": "ts-jest"
44
},
55
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
6-
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
7-
"testPathIgnorePatterns": ["node_modules", "legacy", "dist", "dist-esm"]
8-
}
6+
"moduleFileExtensions": [
7+
"ts",
8+
"tsx",
9+
"js",
10+
"jsx",
11+
"json",
12+
"node"
13+
],
14+
"testPathIgnorePatterns": [
15+
"node_modules",
16+
"legacy",
17+
"dist",
18+
"dist-esm"
19+
],
20+
"testResultsProcessor": "./node_modules/jest-junit-reporter",
21+
"collectCoverage": true
22+
}

0 commit comments

Comments
 (0)