From 0292f6636592253f8d55377f9243e52bf9a639ec Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 16 May 2022 16:15:08 +0100 Subject: [PATCH] Fix coverage reporting to Sonar (#22223) --- package.json | 12 +++++++++++- yarn.lock | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 059c70b705..d2d1c82dd9 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "jest": "^26.6.3", "jest-environment-jsdom-sixteen": "^1.0.3", "jest-raw-loader": "^1.0.1", + "jest-sonar-reporter": "^2.0.0", "json-loader": "^0.5.7", "loader-utils": "^1.4.0", "matrix-mock-request": "^1.2.3", @@ -191,6 +192,15 @@ "transformIgnorePatterns": [ "/node_modules/(?!matrix-js-sdk).+$", "/node_modules/(?!matrix-react-sdk).+$" - ] + ], + "coverageReporters": [ + "text-summary", + "lcov" + ], + "testResultsProcessor": "jest-sonar-reporter" + }, + "jestSonar": { + "reportPath": "coverage", + "sonar56x": true } } diff --git a/yarn.lock b/yarn.lock index baeeefbc70..06d13ad97e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7603,6 +7603,13 @@ jest-snapshot@^26.6.2: pretty-format "^26.6.2" semver "^7.3.2" +jest-sonar-reporter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz#faa54a7d2af7198767ee246a82b78c576789cf08" + integrity sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w== + dependencies: + xml "^1.0.1" + jest-util@^25.1.0, jest-util@^25.5.0: version "25.5.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.5.0.tgz#31c63b5d6e901274d264a4fec849230aa3fa35b0" @@ -13228,6 +13235,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= + xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"