diff --git a/.eslintignore b/.eslintignore index 1003a5fae..26f7c9ee6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,3 +2,4 @@ backend/dist backend/__migration__ docker backend/scripts +**/vitest.config.js diff --git a/backend/__tests__/global-setup.ts b/backend/__tests__/global-setup.ts index 461ccb2f4..573bff62c 100644 --- a/backend/__tests__/global-setup.ts +++ b/backend/__tests__/global-setup.ts @@ -1,5 +1,6 @@ import * as MongoDbMock from "vitest-mongodb"; -export async function setup({ provide }): Promise { +export async function setup(): Promise { + process.env.TZ = "UTC"; await MongoDbMock.setup({ serverOptions: { binary: { diff --git a/frontend/__tests__/global-setup.ts b/frontend/__tests__/global-setup.ts new file mode 100644 index 000000000..89d5cfe50 --- /dev/null +++ b/frontend/__tests__/global-setup.ts @@ -0,0 +1,3 @@ +export const setup = () => { + process.env.TZ = "UTC"; +}; diff --git a/frontend/vitest.config.js b/frontend/vitest.config.js index 5351a7ac9..3d607161a 100644 --- a/frontend/vitest.config.js +++ b/frontend/vitest.config.js @@ -4,6 +4,7 @@ export default defineConfig({ test: { globals: true, environment: "happy-dom", + globalSetup: "__tests__/global-setup.ts", setupFiles: ["__tests__/setup-tests.ts"], coverage: {