Skip to content

Commit

Permalink
chore: fix InlineSnapshots test file type error (#13402)
Browse files Browse the repository at this point in the history
  • Loading branch information
weidehai committed Oct 7, 2022
1 parent fd13a10 commit aeab64e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/jest-snapshot/src/__tests__/InlineSnapshots.test.ts
Expand Up @@ -15,18 +15,18 @@ import {saveInlineSnapshots} from '../InlineSnapshots';
jest.mock('prettier', () => {
const realPrettier =
jest.requireActual<typeof import('prettier')>('prettier');
const mockPrettier: typeof import('prettier') = {
const mockPrettier = {
format: (text, opts) =>
realPrettier.format(text, {
pluginSearchDirs: [
require('path').dirname(require.resolve('prettier')),
],
...opts,
}),
getFileInfo: {sync: () => ({ignored: false, inferredParser: 'babel'})},
resolveConfig: {sync: jest.fn()},
getFileInfo: {sync: () => ({ignored: false, inferredParser: 'babel'})} as unknown as typeof prettier.getFileInfo,
resolveConfig: {sync: jest.fn()} as unknown as typeof prettier.resolveConfig,
version: realPrettier.version,
};
} as typeof prettier;
return mockPrettier;
});

Expand Down

0 comments on commit aeab64e

Please sign in to comment.