mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-04-17 21:37:06 -04:00
* chore: migrate to vitest * test: speed up some suites by sharing sessions and mocking expensive non-tested actions * test: refactor some tests to verify behavior instead of implementation details * chore: fix linting issues
33 lines
657 B
TypeScript
33 lines
657 B
TypeScript
import "./setup-shared";
|
|
import { afterAll, afterEach, beforeAll, vi } from "vitest";
|
|
import { client } from "~/client/api-client/client.gen";
|
|
import { server } from "~/test/msw/server";
|
|
|
|
vi.mock(import("~/client/hooks/use-root-loader-data"), () => ({
|
|
useRootLoaderData: () => ({
|
|
theme: "dark",
|
|
locale: "en-US",
|
|
timeZone: "UTC",
|
|
dateFormat: "MM/DD/YYYY",
|
|
timeFormat: "12h",
|
|
now: Date.now(),
|
|
}),
|
|
}));
|
|
|
|
client.setConfig({
|
|
baseUrl: "http://localhost:3000",
|
|
credentials: "include",
|
|
});
|
|
|
|
beforeAll(() => {
|
|
server.listen({ onUnhandledRequest: "error" });
|
|
});
|
|
|
|
afterEach(() => {
|
|
server.resetHandlers();
|
|
});
|
|
|
|
afterAll(() => {
|
|
server.close();
|
|
});
|