correct and complete unit tests in Front-End

This commit is contained in:
Laurent GAY
2025-06-11 18:49:45 +02:00
parent 2fa54e8282
commit 533ecbdbba
67 changed files with 1900 additions and 203 deletions

View File

@@ -2,8 +2,19 @@ import "./specs/mocks/matchMedia";
import { config } from "@vue/test-utils";
import { createHead } from "@unhead/vue";
import { i18n } from "@/utils/i18n";
import { afterEach, beforeEach, vi } from "vitest";
const head = createHead();
config.global.plugins.push(head);
config.global.plugins.push(i18n);
beforeEach(() => {
const mokeDate = new Date(2022, 1, 2, 3, 4);
vi.useFakeTimers();
vi.setSystemTime(mokeDate);
});
afterEach(() => {
vi.useRealTimers();
});