Skip to content

Commit

Permalink
ts-expect-error now needed because we no longer define the requireOut…
Browse files Browse the repository at this point in the history
…side global
  • Loading branch information
jeysal committed Nov 14, 2020
1 parent 9651814 commit 857d5eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/jest-snapshot/src/InlineSnapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ import type {Config} from '@jest/types';
import type {Frame} from 'jest-message-util';
import {escapeBacktickString} from './utils';

// @ts-expect-error requireOutside Babel transform
const babelTraverse = (requireOutside(
'@babel/traverse',
) as typeof import('@babel/traverse')).default;
// @ts-expect-error requireOutside Babel transform
const generate = (requireOutside(
'@babel/generator',
) as typeof import('@babel/generator')).default;
// @ts-expect-error requireOutside Babel transform
const {file, templateElement, templateLiteral} = requireOutside(
'@babel/types',
) as typeof import('@babel/types');
// @ts-expect-error requireOutside Babel transform
const {parseSync} = requireOutside(
'@babel/core',
) as typeof import('@babel/core');
Expand All @@ -39,7 +43,8 @@ export function saveInlineSnapshots(
prettierPath: Config.Path,
): void {
const prettier = prettierPath
? (requireOutside(prettierPath) as typeof import('prettier'))
? // @ts-expect-error requireOutside Babel transform
(requireOutside(prettierPath) as typeof import('prettier'))
: null;

const snapshotsByFile = groupSnapshotsByFile(snapshots);
Expand Down

0 comments on commit 857d5eb

Please sign in to comment.