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:
committed by
Adolfo R. Brandes
parent
444e825fde
commit
12670240b3
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user