UNPKG

1.36 kBPlain TextView Raw
1import { FileDescriptions, StrykerOptions } from '@stryker-mutator/api/core';
2import { LoggerFactoryMethod } from '@stryker-mutator/api/logging';
3import { commonTokens, tokens } from '@stryker-mutator/api/plugin';
4
5import { IdGenerator } from '../child-proxy/id-generator.js';
6
7import { coreTokens } from '../di/index.js';
8import { LoggingClientContext } from '../logging/logging-client-context.js';
9
10import { CheckerChildProcessProxy } from './checker-child-process-proxy.js';
11import { CheckerFacade } from './checker-facade.js';
12import { CheckerRetryDecorator } from './checker-retry-decorator.js';
13
14createCheckerFactory.inject = tokens(
15 commonTokens.options,
16 commonTokens.fileDescriptions,
17 coreTokens.loggingContext,
18 coreTokens.pluginModulePaths,
19 commonTokens.getLogger,
20 coreTokens.workerIdGenerator
21);
22export function createCheckerFactory(
23 options: StrykerOptions,
24 fileDescriptions: FileDescriptions,
25 loggingContext: LoggingClientContext,
26 pluginModulePaths: readonly string[],
27 getLogger: LoggerFactoryMethod,
28 idGenerator: IdGenerator
29): () => CheckerFacade {
30 return () =>
31 new CheckerFacade(
32 () =>
33 new CheckerRetryDecorator(
34 () => new CheckerChildProcessProxy(options, fileDescriptions, pluginModulePaths, loggingContext, idGenerator),
35 getLogger(CheckerRetryDecorator.name)
36 )
37 );
38}