test: allow UI scenarios more time in CI #1
Frontend verify / verify (push) Successful in 4m54s
Frontend verify / verify (push) Successful in 4m54s
This commit is contained in:
+4
-1
@@ -1,10 +1,13 @@
|
|||||||
import "@testing-library/jest-dom/vitest";
|
import "@testing-library/jest-dom/vitest";
|
||||||
import { cleanup } from "@testing-library/react";
|
import { cleanup, configure } from "@testing-library/react";
|
||||||
import { afterAll, afterEach, beforeAll } from "vitest";
|
import { afterAll, afterEach, beforeAll } from "vitest";
|
||||||
import { configureAuthClient } from "@/shared/api";
|
import { configureAuthClient } from "@/shared/api";
|
||||||
import "../shared/i18n";
|
import "../shared/i18n";
|
||||||
import { server } from "./server";
|
import { server } from "./server";
|
||||||
|
|
||||||
|
// Allow async UI updates on the slower CI runner; local waits stay unchanged.
|
||||||
|
if (process.env.CI) configure({ asyncUtilTimeout: 5_000 });
|
||||||
|
|
||||||
beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
|
beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ import { fileURLToPath, URL } from "node:url";
|
|||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import { configDefaults, defineConfig } from "vitest/config";
|
import { configDefaults, defineConfig } from "vitest/config";
|
||||||
|
|
||||||
|
const CI_TEST_TIMEOUT_MS = 15_000;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) } },
|
resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) } },
|
||||||
test: {
|
test: {
|
||||||
|
// CI runs the UI scenarios with coverage on a slower runner.
|
||||||
|
testTimeout: process.env.CI ? CI_TEST_TIMEOUT_MS : undefined,
|
||||||
environment: "jsdom",
|
environment: "jsdom",
|
||||||
exclude: configDefaults.exclude,
|
exclude: configDefaults.exclude,
|
||||||
setupFiles: "./src/test/setup.ts",
|
setupFiles: "./src/test/setup.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user