@copilotkit/react-core
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
27 lines (24 loc) • 647 B
text/typescript
// Mock modules that cause ES module issues
jest.mock("@segment/analytics-node", () => ({
Analytics: jest.fn().mockImplementation(() => ({
track: jest.fn(),
identify: jest.fn(),
page: jest.fn(),
group: jest.fn(),
alias: jest.fn(),
})),
}));
jest.mock("@copilotkit/shared", () => ({
parseJson: jest.fn((jsonString, defaultValue) => {
try {
return JSON.parse(jsonString);
} catch {
return defaultValue;
}
}),
CopilotKitAgentDiscoveryError: jest.fn(),
}));
// Mock react-dom/test-utils to avoid compatibility issues
jest.mock("react-dom/test-utils", () => ({
act: jest.fn((fn) => fn()),
}));