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 Jul 30, 2019
1 parent b8fbed2 commit 485de83
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 485de83

Please sign in to comment.