Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
VickyStash committed Feb 28, 2024
1 parent 505cb28 commit 858de5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/unit/deepReplaceKeysAndValuesTest.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/naming-convention */
import deepReplaceKeysAndValues from '@libs/deepReplaceKeysAndValues';
import type {ReplaceableValue} from '@libs/deepReplaceKeysAndValues';

Expand Down
14 changes: 7 additions & 7 deletions tests/utils/ReportTestUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ReportAction, ReportActions} from '@src/types/onyx';
import {ActionName} from '@src/types/onyx/OriginalMessage';
import type {ReportAction, ReportActions} from '@src/types/onyx';
import type {ActionName} from '@src/types/onyx/OriginalMessage';
import createRandomReportAction from './collections/reportActions';

const actionNames: ActionName[] = ['ADDCOMMENT', 'IOU', 'REPORTPREVIEW', 'CLOSED'];
Expand Down Expand Up @@ -48,12 +48,12 @@ const getFakeReportAction = (index: number, actionName?: ActionName): ReportActi
whisperedToAccountIDs: [],
} as ReportAction);

const getMockedSortedReportActions = (length = 100): ReportAction[] => Array.from({length}, (__, i): ReportAction => getFakeReportAction(i));
const getMockedSortedReportActions = (length = 100): ReportAction[] => Array.from({length}, (element, index): ReportAction => getFakeReportAction(index));

const getMockedReportActionsMap = (length = 100): ReportActions => {
const mockReports: ReportActions[] = Array.from({length}, (__, i): ReportActions => {
const reportID = i + 1;
const actionName: ActionName = i === 0 ? 'CREATED' : actionNames[i % actionNames.length];
const mockReports: ReportActions[] = Array.from({length}, (element, index): ReportActions => {
const reportID = index + 1;
const actionName: ActionName = index === 0 ? 'CREATED' : actionNames[index % actionNames.length];
const reportAction = {
...createRandomReportAction(reportID),
actionName,
Expand All @@ -64,7 +64,7 @@ const getMockedReportActionsMap = (length = 100): ReportActions => {

return {[reportID]: reportAction};
});
return Object.assign({}, ...mockReports);
return Object.assign({}, ...mockReports) as ReportActions;
};

export {getFakeReportAction, getMockedSortedReportActions, getMockedReportActionsMap};

0 comments on commit 858de5f

Please sign in to comment.