Skip to content

Commit

Permalink
fix repl
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Mar 14, 2021
1 parent fa68cfe commit 76b2b75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/jest-repl/src/__tests__/jest_repl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
*/
'use strict';

import {spawnSync} from 'child_process';
import path from 'path';
Expand All @@ -29,6 +28,7 @@ describe('Repl', () => {
encoding: 'utf8',
env: process.env,
});
expect(output.stderr.trim()).toBe('');
expect(output.stdout.trim()).toMatch(//);
});
});
Expand Down
3 changes: 2 additions & 1 deletion packages/jest-repl/src/cli/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import * as repl from 'repl';
import {runInThisContext} from 'vm';
import type {SyncTransformer} from '@jest/transform';
import type {Config} from '@jest/types';
import {interopRequireDefault} from 'jest-util';

// TODO: support async as well
let transformer: SyncTransformer;
Expand Down Expand Up @@ -77,7 +78,7 @@ if (jestProjectConfig.transform) {
}
}
if (transformerPath) {
transformer = require(transformerPath);
transformer = interopRequireDefault(require(transformerPath)).default;
if (typeof transformer.process !== 'function') {
throw new TypeError(
'Jest: a transformer must export a `process` function.',
Expand Down

0 comments on commit 76b2b75

Please sign in to comment.