mirror of
https://github.com/coder/coder.git
synced 2026-06-04 05:28:20 +00:00
a581431bc8
- Fix to display apps with disabled health status on workspaces list - Migrate WorkspacesPage jest test into vitest - Modularize vitest setup into separate files: - setup/polyfills.ts: Blob, ResizeObserver polyfills - setup/domStubs.ts: Radix UI pointer capture stubs - setup/mocks.ts: useProxyLatency mock - setup/msw.ts: MSW server lifecycle Fixed #20319
12 lines
419 B
TypeScript
12 lines
419 B
TypeScript
// Mock useProxyLatency to avoid real network requests to external proxy URLs.
|
|
// Must use useMemo to return stable object references and prevent infinite re-renders.
|
|
vi.mock("contexts/useProxyLatency", async () => {
|
|
const { useMemo } = await import("react");
|
|
return {
|
|
useProxyLatency: () => {
|
|
const proxyLatencies = useMemo(() => ({}), []);
|
|
return { proxyLatencies, refetch: () => new Date() };
|
|
},
|
|
};
|
|
});
|