Skip to content

Commit

Permalink
feat(jest-runner): resolve local jest version (#2623)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicojs committed Nov 19, 2020
1 parent 5b92130 commit 1466f9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/jest-runner/src/utils/jest-wrapper.ts
@@ -1,10 +1,14 @@
import * as jest from 'jest';
import { requireResolve } from '@stryker-mutator/util';
import type * as jestModule from 'jest';

// Use requireResolve, that way you can use this plugin from a different directory
const jest = requireResolve('jest') as typeof jestModule;

/**
* Direct stubbing on jest is no longer possible since jest > 25
*/
class JestWrapper {
public runCLI: typeof jest.runCLI = (...args) => {
public runCLI: typeof jestModule.runCLI = (...args) => {
return jest.runCLI(...args);
};
}
Expand Down

0 comments on commit 1466f9a

Please sign in to comment.