From 280b2555297157aed16e5636bfc450f6e6c1707e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 21 Sep 2022 10:33:50 +0200 Subject: [PATCH] Fix vitest junit coverage runs Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 2 +- js/jest.config.js | 20 -------------------- js/vite.config.js | 3 +++ 3 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 js/jest.config.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fff3c6ef..26f059bc1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,7 +134,7 @@ vitest: before_script: - yarn --cwd "js" install --frozen-lockfile script: - - yarn --cwd "js" run coverage --reporter=junit --outputFile.junit=./js/junit.xml + - yarn --cwd "js" run coverage --reporter=default --reporter=junit --outputFile.junit=./js/junit.xml artifacts: when: always paths: diff --git a/js/jest.config.js b/js/jest.config.js deleted file mode 100644 index a87688fe7..000000000 --- a/js/jest.config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel", - collectCoverage: true, - collectCoverageFrom: [ - "**/*.{vue,ts}", - "!**/node_modules/**", - "!get_union_json.ts", - ], - coverageReporters: ["html", "text", "text-summary"], - reporters: ["default", "jest-junit"], - // The following should fix the issue with svgs and ?inline loader (see Logo.vue), but doesn't work - // - // transform: { - // "^.+\\.svg$": "/tests/unit/svgTransform.js", - // }, - // moduleNameMapper: { - // "^@/(.*svg)(\\?inline)$": "/src/$1", - // "^@/(.*)$": "/src/$1", - // }, -}; diff --git a/js/vite.config.js b/js/vite.config.js index ca4628a9a..96a88d348 100644 --- a/js/vite.config.js +++ b/js/vite.config.js @@ -74,6 +74,9 @@ export default defineConfig(({ command }) => { "@": path.resolve(__dirname, "./src"), }, }, + coverage: { + reporter: ["text", "json", "html"], + }, setupFiles: path.resolve(__dirname, "./tests/unit/setup.ts"), include: [path.resolve(__dirname, "./tests/unit/specs/**/*.spec.ts")], },