How to use the @stryker-mutator/api/plugin.declareFactoryPlugin function in @stryker-mutator/api

To help you get started, we’ve selected a few @stryker-mutator/api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stryker-mutator / stryker / packages / typescript / src / index.ts View on Github external
import { declareClassPlugin, declareFactoryPlugin, PluginKind } from '@stryker-mutator/api/plugin';

import TypescriptConfigEditor from './TypescriptConfigEditor';
import { typescriptMutatorFactory } from './TypescriptMutator';
import TypescriptTranspiler from './TypescriptTranspiler';

export const strykerPlugins = [
  declareClassPlugin(PluginKind.ConfigEditor, 'typescript', TypescriptConfigEditor),
  declareClassPlugin(PluginKind.Transpiler, 'typescript', TypescriptTranspiler),
  declareFactoryPlugin(PluginKind.Mutator, 'typescript', typescriptMutatorFactory)
];
github stryker-mutator / stryker / packages / jest-runner / src / index.ts View on Github external
import { declareClassPlugin, declareFactoryPlugin, PluginKind } from '@stryker-mutator/api/plugin';

import JestConfigEditor from './JestConfigEditor';
import { jestTestRunnerFactory } from './JestTestRunner';

process.env.BABEL_ENV = 'test';

export const strykerPlugins = [
  declareClassPlugin(PluginKind.ConfigEditor, 'jest', JestConfigEditor),
  declareFactoryPlugin(PluginKind.TestRunner, 'jest', jestTestRunnerFactory)
];
github stryker-mutator / stryker / packages / babel-transpiler / src / index.ts View on Github external
import { declareFactoryPlugin, PluginKind } from '@stryker-mutator/api/plugin';

import { babelTranspilerFactory } from './BabelTranspiler';

export const strykerPlugins = [declareFactoryPlugin(PluginKind.Transpiler, 'babel', babelTranspilerFactory)];
github stryker-mutator / stryker / packages / vue-mutator / src / index.ts View on Github external
import { commonTokens, declareFactoryPlugin, Injector, OptionsContext, PluginKind, tokens } from '@stryker-mutator/api/plugin';

import { MUTATORS_TOKEN, mutatorsFactory } from './helpers/MutatorHelpers';
import VueMutator from './VueMutator';

export const strykerPlugins = [declareFactoryPlugin(PluginKind.Mutator, 'vue', vueMutatorFactory)];

function vueMutatorFactory(injector: Injector) {
  return injector.provideFactory(MUTATORS_TOKEN, mutatorsFactory).injectClass(VueMutator);
}
vueMutatorFactory.inject = tokens(commonTokens.injector);
github stryker-mutator / stryker / packages / javascript-mutator / src / index.ts View on Github external
import { commonTokens, declareFactoryPlugin, Injector, OptionsContext, PluginKind, tokens } from '@stryker-mutator/api/plugin';

import { JavaScriptMutator } from './JavaScriptMutator';
import { nodeMutators } from './mutators';
import { NODE_MUTATORS_TOKEN, PARSER_TOKEN } from './helpers/tokens';
import BabelParser from './helpers/BabelParser';

export const strykerPlugins = [declareFactoryPlugin(PluginKind.Mutator, 'javascript', javaScriptMutatorFactory)];

function javaScriptMutatorFactory(injector: Injector): JavaScriptMutator {
  return injector
    .provideValue(NODE_MUTATORS_TOKEN, nodeMutators)
    .provideClass(PARSER_TOKEN, BabelParser)
    .injectClass(JavaScriptMutator);
}
javaScriptMutatorFactory.inject = tokens(commonTokens.injector);
github stryker-mutator / stryker / packages / webpack-transpiler / src / index.ts View on Github external
import { commonTokens, declareFactoryPlugin, Injector, PluginKind, tokens, TranspilerPluginContext } from '@stryker-mutator/api/plugin';

import ConfigLoader from './compiler/ConfigLoader';
import { pluginTokens } from './pluginTokens';
import WebpackTranspiler from './WebpackTranspiler';

export const strykerPlugins = [declareFactoryPlugin(PluginKind.Transpiler, 'webpack', webpackTranspilerFactory)];

function webpackTranspilerFactory(injector: Injector) {
  return injector
    .provideValue(pluginTokens.require, require)
    .provideClass(pluginTokens.configLoader, ConfigLoader)
    .injectClass(WebpackTranspiler);
}
webpackTranspilerFactory.inject = tokens(commonTokens.injector);
github stryker-mutator / stryker / packages / core / src / reporters / index.ts View on Github external
import { declareClassPlugin, declareFactoryPlugin, PluginKind } from '@stryker-mutator/api/plugin';

import ClearTextReporter from './ClearTextReporter';
import { dashboardReporterFactory } from './dashboard-reporter';
import DotsReporter from './DotsReporter';
import EventRecorderReporter from './EventRecorderReporter';
import ProgressAppendOnlyReporter from './ProgressAppendOnlyReporter';
import ProgressReporter from './ProgressReporter';

export const strykerPlugins = [
  declareClassPlugin(PluginKind.Reporter, 'clear-text', ClearTextReporter),
  declareClassPlugin(PluginKind.Reporter, 'progress', ProgressReporter),
  declareClassPlugin(PluginKind.Reporter, 'progress-append-only', ProgressAppendOnlyReporter),
  declareClassPlugin(PluginKind.Reporter, 'dots', DotsReporter),
  declareClassPlugin(PluginKind.Reporter, 'event-recorder', EventRecorderReporter),
  declareFactoryPlugin(PluginKind.Reporter, 'dashboard', dashboardReporterFactory)
];
github stryker-mutator / stryker / packages / mocha-runner / src / index.ts View on Github external
import { BaseContext, commonTokens, declareClassPlugin, declareFactoryPlugin, Injector, PluginKind, tokens } from '@stryker-mutator/api/plugin';

import MochaConfigEditor from './MochaConfigEditor';
import MochaOptionsLoader from './MochaOptionsLoader';
import MochaTestRunner from './MochaTestRunner';

export const strykerPlugins = [
  declareFactoryPlugin(PluginKind.ConfigEditor, 'mocha-runner', mochaConfigEditorFactory),
  declareClassPlugin(PluginKind.TestRunner, 'mocha', MochaTestRunner)
];

mochaConfigEditorFactory.inject = tokens(commonTokens.injector);
function mochaConfigEditorFactory(injector: Injector): MochaConfigEditor {
  return injector.provideClass('loader', MochaOptionsLoader).injectClass(MochaConfigEditor);
}