feat(tests): add jest-junit reporter for Azure DevOps integration

This commit is contained in:
Lorenz Hilpert
2025-04-25 19:15:29 +02:00
parent a48ff29051
commit 5db3521a0e
3 changed files with 19 additions and 1 deletions

View File

@@ -4,6 +4,22 @@ module.exports = {
...nxPreset,
// Configure coverage reporters to include Cobertura XML reports
coverageReporters: ['text', 'cobertura'],
// Add Jest JUnit reporter for Azure DevOps integration
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: 'testresults',
outputName: 'TESTS',
uniqueOutputName: 'true', // Needs to be a string for jest-junit
classNameTemplate: '{classname}',
titleTemplate: '{title}',
ancestorSeparator: ' ',
usePathForSuiteName: true,
},
],
],
// Ensure coverage is collected from all relevant files
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',

1
package-lock.json generated
View File

@@ -90,6 +90,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-preset-angular": "~14.4.0",
"ng-mocks": "^14.13.4",
"ng-swagger-gen": "^2.3.1",

View File

@@ -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 --coverage",
"ci": "npx nx run-many -t test --exclude isa-app -c ci --coverage --reporters=jest-junit",
"build": "nx build isa-app --configuration=development",
"build-prod": "nx build isa-app --configuration=production",
"lint": "nx lint",
@@ -101,6 +101,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-environment-node": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-preset-angular": "~14.4.0",
"ng-mocks": "^14.13.4",
"ng-swagger-gen": "^2.3.1",