From 579e45e5ae8dc0a6b0764e2ad8558ffa6807c086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Chaves?= Date: Mon, 3 Jul 2023 20:21:20 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20adi=C3=A7=C3=A3o=20da=20lib=20vitest-son?= =?UTF-8?q?ar-reporter=20para=20envio=20de=20dura=C3=A7=C3=A3o=20dos=20tes?= =?UTF-8?q?tes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- sonar-project.properties | 6 +++--- vitest.config.ts | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a428a340..d187baf1 100755 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "react-render-if-visible": "^2.1.1", "react-router-dom": "^6.6.1", "react-toastify": "^9.1.2", - "sass": "^1.57.1" + "sass": "^1.57.1", + "vitest-sonar-reporter": "^0.4.0" }, "devDependencies": { "@testing-library/jest-dom": "^5.16.5", diff --git a/sonar-project.properties b/sonar-project.properties index c9f93f91..fce2b2be 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,9 +9,9 @@ sonar.organization=fga-eps-mds-1 sonar.sources=. sonar.exclusions=**/*.spec.tsx,**/metrics/*.py -sonar.tests=./src, -sonar.test.inclusions=**/*.spec.tsx,**/*.spec.ts, -sonar.typescript.lcov.reportPaths=./coverage/lcov.info, +sonar.tests=./src +sonar.test.inclusions=**/*.spec.tsx,**/*.spec.ts sonar.javascript.lcov.reportPaths=./coverage/lcov.info sonar.eslint.reportPaths=reports/eslint-report.json +sonar.testExecutionReportPaths=coverage.xml sonar.sourceEncoding=UTF-8 \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index 6663b59f..767095ed 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -8,5 +8,7 @@ export default defineConfig({ coverage: { reporter: ['lcov', 'html'] }, environment: 'jsdom', setupFiles: './src/config/tests/setup-tests.ts', + reporters: 'vitest-sonar-reporter', + outputFile: 'coverage.xml', }, });