From 6a9fba7db893d856818c970eb602ac9452fb2353 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 21 Sep 2022 08:32:42 +0200 Subject: [PATCH] Fix tests for CI Signed-off-by: Thomas Citharel --- .gitlab-ci.yml | 4 +- js/package.json | 1 + .../__snapshots__/PostListItem.spec.ts.snap | 2 +- .../__snapshots__/ReportModal.spec.ts.snap | 2 +- .../__snapshots__/navbar.spec.ts.snap | 10 +- js/yarn.lock | 136 +++++++++++++++++- lib/web/templates/page/index.html.heex | 2 +- lib/web/views/auth_view.ex | 3 +- lib/web/views/error_view.ex | 3 +- lib/web/views/page_view.ex | 2 +- .../transmogrifier/delete_test.exs | 2 +- .../transmogrifier/update_test.exs | 6 +- test/graphql/api/search_test.exs | 1 + test/graphql/resolvers/activity_test.exs | 8 +- test/graphql/resolvers/group_test.exs | 2 +- test/graphql/resolvers/person_test.exs | 4 +- test/graphql/resolvers/user_test.exs | 4 +- test/mobilizon/actors/actors_test.exs | 2 +- test/web/plugs/http_security_plug_test.exs | 2 +- test/web/views/error_view_test.exs | 2 +- 20 files changed, 164 insertions(+), 34 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 66a805a23..a8fe24257 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -127,14 +127,14 @@ exunit: - test-junit-report.xml expire_in: 30 days -jest: +vitest: stage: test needs: - lint-front before_script: - yarn --cwd "js" install --frozen-lockfile script: - - yarn --cwd "js" run test:unit --no-color --ci --reporters=default --reporters=jest-junit + - yarn --cwd "js" run coverage --reporter=junit --outputFile.junit=./junit.xml artifacts: when: always paths: diff --git a/js/package.json b/js/package.json index 42c3de362..4287e202f 100644 --- a/js/package.json +++ b/js/package.json @@ -112,6 +112,7 @@ "@types/prosemirror-view": "^1.11.4", "@types/sanitize-html": "^2.5.0", "@vitejs/plugin-vue": "^3.0.3", + "@vitest/coverage-c8": "^0.23.4", "@vitest/ui": "^0.23.4", "@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-typescript": "^11.0.0", diff --git a/js/tests/unit/specs/components/Post/__snapshots__/PostListItem.spec.ts.snap b/js/tests/unit/specs/components/Post/__snapshots__/PostListItem.spec.ts.snap index 0507869a5..39160cfa3 100644 --- a/js/tests/unit/specs/components/Post/__snapshots__/PostListItem.spec.ts.snap +++ b/js/tests/unit/specs/components/Post/__snapshots__/PostListItem.spec.ts.snap @@ -30,7 +30,7 @@ exports[`PostListItem > renders post list item with tags 1`] = `

My Blog Post

Dec 2, 2020

-
A tag
+
A tag
" diff --git a/js/tests/unit/specs/components/Report/__snapshots__/ReportModal.spec.ts.snap b/js/tests/unit/specs/components/Report/__snapshots__/ReportModal.spec.ts.snap index b1ca4cea6..d7bf4b08c 100644 --- a/js/tests/unit/specs/components/Report/__snapshots__/ReportModal.spec.ts.snap +++ b/js/tests/unit/specs/components/Report/__snapshots__/ReportModal.spec.ts.snap @@ -20,7 +20,7 @@ exports[`ReportModal > renders report modal with basic informations and submits -