Skip to content

Commit

Permalink
chore: Use transformer from @jest/transformer instead of Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark1626 committed Aug 8, 2019
1 parent b93833b commit 2571c1f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/jest-runtime/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import yargs from 'yargs';
import {Config} from '@jest/types';
import {JestEnvironment} from '@jest/environment';
import {CustomConsole} from '@jest/console';
import {setGlobal} from 'jest-util';
import {setGlobal, interopRequireDefault} from 'jest-util';
import {validateCLIOptions} from 'jest-validate';
import {readConfig, deprecationEntries} from 'jest-config';
import {ScriptTransformer} from '@jest/transform';
import {VERSION} from '../version';
import {Context} from '../types';
import * as args from './args';
Expand Down Expand Up @@ -82,10 +83,10 @@ export function run(cliArgv?: Config.Argv, cliInfo?: Array<string>) {
watchman: globalConfig.watchman,
}) as Promise<Context>)
.then(async hasteMap => {
const transformer = new Runtime.ScriptTransformer(config);
const Environment: typeof JestEnvironment = await transformer.requireAndTranspileModule(
config.testEnvironment,
);
const transformer = new ScriptTransformer(config);
const Environment: typeof JestEnvironment = interopRequireDefault(
await transformer.requireAndTranspileModule(config.testEnvironment),
).default;
const environment = new Environment(config);
setGlobal(
environment.global,
Expand Down

0 comments on commit 2571c1f

Please sign in to comment.