diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6dab13bf..7f27eedd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,3 +26,15 @@ steps: - script: | yarn test displayName: 'Run tests' + +- task: PublishTestResults@2 + displayName: 'Publish Test Results' + inputs: + testResultsFiles: '**junit*.xml' + testRunTitle: TestRun ${{ parameters.name }} $(node_version) + +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage results' + inputs: + codeCoverageTool: 'cobertura' + summaryFileLocation: '**/coverage/cobertura-coverage.xml' \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 1a481c6b..2433cbf7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,5 +8,6 @@ module.exports = { rootDir: 'test', modulePaths: ['/lib'], globalSetup: '/jest-global-setup.js', - globalTeardown: '/jest-global-teardown.js' + globalTeardown: '/jest-global-teardown.js', + coverageReporters: ['text', 'lcov', 'cobertura'] } diff --git a/package.json b/package.json index eef2c097..eaf257b5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "bootstrap": "lerna bootstrap", "dev": "lerna run build --stream --parallel", "testonly": "jest", - "testall": "npm run testonly -- --coverage --forceExit --runInBand", + "testall": "npm run testonly -- --coverage --forceExit --runInBand --reporters=default --reporters=jest-junit", "pretest": "npm run lint", "test": "npm run testall || npm run testall", "coveralls": "cat ./test/coverage/lcov.info | coveralls", @@ -52,6 +52,7 @@ "fkill": "5.1.0", "flatten": "1.0.2", "get-port": "3.2.0", + "jest-junit": "^5.0.0", "jest-cli": "23.6.0", "lerna": "^3.4.0", "lint-staged": "4.2.3",