diff --git a/app/src/components/featuredItem/campaignHero.tsx b/app/src/components/featuredItem/campaignHero.tsx index 5f81528c..9e1c212a 100644 --- a/app/src/components/featuredItem/campaignHero.tsx +++ b/app/src/components/featuredItem/campaignHero.tsx @@ -15,7 +15,11 @@ const CampaignHero = ({ featuredItemData }) => { ); const handleError = (e: React.SyntheticEvent) => { - console.log("Error loading campaign hero:", e); + if ((window as any).newrelic) { + (window as any).newrelic.log("Error loading campaign hero", { + level: "warn", + }); + } setData(defaultFeaturedItemResponse); }; diff --git a/app/src/utils/fetchApi.ts b/app/src/utils/fetchApi.ts index 5f595f03..f8f46e01 100644 --- a/app/src/utils/fetchApi.ts +++ b/app/src/utils/fetchApi.ts @@ -42,7 +42,6 @@ export const fetchApi = async ( ), ]); }; - logger.error("test error from fetch API"); try { const response = (await fetchWithTimeout(apiUrl, { diff --git a/jest.setup.ts b/jest.setup.ts index 327c2872..bbfe30b6 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -16,3 +16,10 @@ global.ResizeObserver = jest.fn().mockImplementation(() => ({ unobserve: jest.fn(), disconnect: jest.fn(), })); + +(global as any).setImmediate = Object.assign( + (fn: (...args: any[]) => void, ...args: any[]) => setTimeout(fn, 0, ...args), + { + __promisify__: () => Promise.resolve(), // Add the __promisify__ property + } +); diff --git a/jestAPI.config.ts b/jestAPI.config.ts index e225faf8..6b6b899a 100644 --- a/jestAPI.config.ts +++ b/jestAPI.config.ts @@ -17,7 +17,6 @@ const config = { "__tests__/data/*", "__tests__/pages/*", "__tests__/__mocks__/*", - "__tests__/api/featuredItem", "app/*", ], moduleNameMapper: {