diff --git a/.gitignore b/.gitignore index e1aaddef8..879475d92 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ typedocs/ *-debug.log .build storybook-static/ -.rollup.cache/ \ No newline at end of file +.rollup.cache/ +test-report.xml \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index eb70ab66d..2bc1ba746 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9953,6 +9953,15 @@ } } }, + "jest-sonar-reporter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz", + "integrity": "sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w==", + "dev": true, + "requires": { + "xml": "^1.0.1" + } + }, "jest-util": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", @@ -16406,6 +16415,12 @@ "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", "dev": true }, + "xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", + "dev": true + }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", diff --git a/package.json b/package.json index 60cedeb80..ccc02710d 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "gulp-concat": "^2.6.1", "gulp-dart-sass": "^1.0.2", "jest": "^26.6.3", + "jest-sonar-reporter": "^2.0.0", "jsdom": "^16.4.0", "lerna": "^4.0.0", "merge2": "^1.4.1", diff --git a/packages/dockview/jest.config.js b/packages/dockview/jest.config.js index c00927710..4fd1d632e 100644 --- a/packages/dockview/jest.config.js +++ b/packages/dockview/jest.config.js @@ -21,4 +21,5 @@ module.exports = { '/packages/dockview/src/__tests__/__mocks__', ], coverageDirectory: '/packages/dockview/coverage/', + testResultsProcessor: 'jest-sonar-reporter', }; diff --git a/sonar-project.properties b/sonar-project.properties index 5808cf567..ece11486e 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,6 +2,11 @@ sonar.projectKey=mathuo_dockview sonar.organization=dockview sonar.inclusions=packages/dockview/**/* +sonar.exclusions=packages/dockview/src/__tests__/** +sonar.tests=packages/dockview/src/__tests__ + +sonar.testExecutionReportPaths=packages/dockview/test-report.xml +sonar.javascript.lcov.reportPaths=packages/dockview/coverage/lcov.info # This is the name and version displayed in the SonarCloud UI. #sonar.projectName=dockview @@ -13,4 +18,3 @@ sonar.inclusions=packages/dockview/**/* # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 -sonar.javascript.lcov.reportPaths=packages/dockview/coverage/lcov.info