Skip to content

Commit

Permalink
Add clarifying comment to Lens test mock.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeelmers committed Dec 13, 2019
1 parent 77dfdff commit bc90af3
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ import { createMockedIndexPattern } from '../../mocks';
import { IndexPatternPrivateState } from '../../types';

jest.mock('ui/new_platform', () => {
// Due to the way we are handling shims in the NP migration, we need
// to mock core here so that upstream services don't cause these
// tests to fail. Ordinarly `jest.mock('ui/new_platform')` would be
// sufficient, however we need to mock one of the `uiSettings` return
// values for this suite, so we must manually assemble the mock.
// Because babel hoists `jest` we must use an inline `require`
// to ensure the core mocks are available (`jest.doMock` doesn't
// work in this case). This mock should be able to be replaced
// altogether once Lens has migrated to the new platform.
const { coreMock } = require('src/core/public/mocks'); // eslint-disable-line @typescript-eslint/no-var-requires
return {
npSetup: {
Expand Down

0 comments on commit bc90af3

Please sign in to comment.