diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 02904b6e7..f0206a8b1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,6 @@ variables: - group: 'GithubCMF' jobs: - - job: unittests displayName: Unit Tests pool: @@ -65,7 +64,7 @@ jobs: displayName: Publish code Coverage inputs: codeCoverageTool: Cobertura - summaryFileLocation: $(Build.StagingDirectory)/coverage/**/cobertura.xml + summaryFileLocation: $(Build.StagingDirectory)/coverage/**/cobertura-coverage.xml pathToSources: $(Build.SourcesDirectory) condition: always() - bash: | @@ -96,7 +95,6 @@ jobs: $(Build.BuildNumber)-$(Build.SourceVersion) $(DockerTagSourceBranch) steps: - - task: npmAuthenticate@0 displayName: 'npm auth' inputs: @@ -158,7 +156,7 @@ jobs: - Agent.OS -equals Linux - docker condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/integration'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')) - variables: + variables: - name: DockerTagSourceBranch value: $[replace(variables['Build.SourceBranch'], '/', '_')] - name: 'DockerTag' @@ -195,7 +193,6 @@ jobs: repository: 'isa/ui' command: 'push' tags: '$(DockerTag)' - - task: PublishBuildArtifacts@1 displayName: 'Artefakt veröffentlichen: HelmValues' diff --git a/jest.preset.js b/jest.preset.js index f078ddcec..1dd6b0792 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -1,3 +1,19 @@ const nxPreset = require('@nx/jest/preset').default; -module.exports = { ...nxPreset }; +module.exports = { + ...nxPreset, + // Configure coverage reporters to include Cobertura XML reports + coverageReporters: ['text', 'cobertura'], + // Ensure coverage is collected from all relevant files + collectCoverageFrom: [ + '**/*.{js,jsx,ts,tsx}', + '!**/node_modules/**', + '!**/vendor/**', + '!**/*.spec.{js,jsx,ts,tsx}', + '!**/test-setup.ts', + '!**/index.ts', + '!**/public-api.ts', + '!**/generated/**', + '!**/environments/**', + ], +}; diff --git a/package.json b/package.json index 9aca7d722..f90489167 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "ng": "ng", "start": "nx serve isa-app --ssl", "test": "npx nx run-many -t test --exclude isa-app", - "ci": "npx nx run-many -t test --exclude isa-app -c ci", + "ci": "npx nx run-many -t test --exclude isa-app -c ci --coverage", "build": "nx build isa-app --configuration=development", "build-prod": "nx build isa-app --configuration=production", "lint": "nx lint",