UNPKG

@stryker-mutator/jest-runner

Version:

A plugin to use the jest test runner and framework in Stryker, the JavaScript mutation testing framework

26 lines 932 B
import { pluginTokens } from '../plugin-di.js'; /** * The adapter used for 22 < Jest < 25. * It has a lot of `any` typings here, since the installed typings are not in sync. */ export class JestLessThan25TestAdapter { jestWrapper; static inject = [pluginTokens.jestWrapper]; constructor(jestWrapper) { this.jestWrapper = jestWrapper; } run({ jestConfig, fileNamesUnderTest, testNamePattern, testLocationInResults }) { const config = JSON.stringify(jestConfig); return this.jestWrapper.runCLI({ $0: 'stryker', _: fileNamesUnderTest ? fileNamesUnderTest : [], findRelatedTests: !!fileNamesUnderTest, config, runInBand: true, silent: true, testNamePattern, testLocationInResults, }, [jestConfig.rootDir ?? process.cwd()]); } } //# sourceMappingURL=jest-less-than-25-adapter.js.map