style: add explanatory comments for late imports after jest.mock()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adolfo R. Brandes
2026-03-13 08:27:01 -03:00
committed by Adolfo R. Brandes
parent 444e825fde
commit 12670240b3
5 changed files with 10 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ jest.mock('@openedx/frontend-base', () => ({
getAuthService: jest.fn(),
}));
// jest.mock() must be called before importing the mocked module's members,
// so this import intentionally comes after the mock declaration above.
// eslint-disable-next-line import/first
import { sendPageEvent, sendTrackEvent } from '@openedx/frontend-base';

View File

@@ -44,6 +44,8 @@ jest.mock('@openedx/frontend-base', () => ({
getLocale: jest.fn(),
}));
// jest.mock() must be called before importing the mocked module's members,
// so this import intentionally comes after the mock declaration above.
// eslint-disable-next-line import/first
import { getLocale, sendPageEvent, sendTrackEvent } from '@openedx/frontend-base';

View File

@@ -20,6 +20,8 @@ jest.mock('@openedx/frontend-base', () => ({
getLocale: jest.fn(),
}));
// jest.mock() must be called before importing the mocked module's members,
// so this import intentionally comes after the mock declaration above.
// eslint-disable-next-line import/first
import { getLocale } from '@openedx/frontend-base';

View File

@@ -22,6 +22,8 @@ jest.mock('@openedx/frontend-base', () => ({
getLocale: jest.fn(),
}));
// jest.mock() must be called before importing the mocked module's members,
// so this import intentionally comes after the mock declaration above.
// eslint-disable-next-line import/first
import { getLocale } from '@openedx/frontend-base';

View File

@@ -21,6 +21,8 @@ jest.mock('@openedx/frontend-base', () => ({
getLocale: jest.fn(),
}));
// jest.mock() must be called before importing the mocked module's members,
// so this import intentionally comes after the mock declaration above.
// eslint-disable-next-line import/first
import { getLocale } from '@openedx/frontend-base';