1 | import { pluginTokens } from '../plugin-di.js';
|
2 | export class JestGreaterThan25TestAdapter {
|
3 | jestWrapper;
|
4 | static inject = [pluginTokens.jestWrapper];
|
5 | constructor(jestWrapper) {
|
6 | this.jestWrapper = jestWrapper;
|
7 | }
|
8 | async run({ jestConfig, fileNamesUnderTest, testNamePattern, testLocationInResults }) {
|
9 | const config = JSON.stringify(jestConfig);
|
10 | const result = await this.jestWrapper.runCLI({
|
11 | $0: 'stryker',
|
12 | _: fileNamesUnderTest ? fileNamesUnderTest : [],
|
13 | findRelatedTests: !!fileNamesUnderTest,
|
14 | config,
|
15 | runInBand: true,
|
16 | silent: true,
|
17 | passWithNoTests: true,
|
18 | testNamePattern,
|
19 | testLocationInResults,
|
20 | }, [jestConfig.rootDir ?? process.cwd()]);
|
21 | return result;
|
22 | }
|
23 | }
|
24 |
|
\ | No newline at end of file |