diff --git a/tests/perf-test/OptimisticReportNames.perf-test.ts b/tests/perf-test/OptimisticReportNames.perf-test.ts index 86b75655c0c9..d879fcc6183a 100644 --- a/tests/perf-test/OptimisticReportNames.perf-test.ts +++ b/tests/perf-test/OptimisticReportNames.perf-test.ts @@ -13,7 +13,10 @@ import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; // Mock dependencies jest.mock('@libs/ReportUtils', () => ({ + // jest.requireActual is necessary to include multi-layered module imports (eg. Report.ts has processReportIDDeeplink() which uses parseReportRouteParams() imported from getReportIDFromUrl.ts) + // Without jest.requireActual, parseReportRouteParams would be undefined, causing the test to fail. ...jest.requireActual('@libs/ReportUtils'), + // These methods are mocked below in the beforeAll function to return specific values isExpenseReport: jest.fn(), getTitleReportField: jest.fn(), }));