Skip to content

Commit

Permalink
fix: use import instead of require when loading runner (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Sep 14, 2022
1 parent ee87056 commit f1108ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/createJestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ export default function createRunner<
);
}

_createInBandTestRun(
async _createInBandTestRun(
tests: Array<Test>,
watcher: TestWatcher,
onStart: OnTestStart,
onResult: OnTestSuccess,
onFailure: OnTestFailure,
options: TestRunnerOptions,
): Promise<void> {
const runner = (await import(runPath)).default;

const mutex = pLimit(1);
return tests.reduce(
(promise, test) =>
Expand All @@ -87,8 +89,6 @@ export default function createRunner<
}

return onStart(test).then(() => {
// eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
const runner = require(runPath);
const baseOptions = {
config: test.context.config,
globalConfig: this.#globalConfig,
Expand Down

0 comments on commit f1108ea

Please sign in to comment.