@stryker-mutator/jest-runner
Version:
A plugin to use the jest test runner and framework in Stryker, the JavaScript mutation testing framework
18 lines (15 loc) • 616 B
text/typescript
import type {
JestEnvironmentConfig,
JestEnvironment,
EnvironmentContext,
} from '@jest/environment';
import { state } from './messaging.cjs';
import { loadJestEnvironment } from './import-jest-environment.cjs';
import { mixinJestEnvironment } from './mixin-jest-environment.cjs';
export = function jestEnvironmentGeneric(
...args: [JestEnvironmentConfig, EnvironmentContext]
): JestEnvironment {
const JestEnvironmentImpl = loadJestEnvironment(state.jestEnvironment);
const StrykerAwareJestEnvironment = mixinJestEnvironment(JestEnvironmentImpl);
return new StrykerAwareJestEnvironment(...args);
};