How to use pluginModulePaths method in stryker-parent

Best JavaScript code snippet using stryker-parent

create-checker-factory.it.spec.ts

Source:create-checker-factory.it.spec.ts Github

copy

Full Screen

1import fs from 'fs';2import { URL } from 'url';3import { LogLevel } from '@stryker-mutator/api/core';4import { factory, LoggingServer, testInjector } from '@stryker-mutator/test-helpers';5import { expect } from 'chai';6import { CheckResult, CheckStatus } from '@stryker-mutator/api/check';7import { CheckerFacade, createCheckerFactory } from '../../../src/checker/index.js';8import { coreTokens } from '../../../src/di/index.js';9import { LoggingClientContext } from '../../../src/logging/index.js';10import { TwoTimesTheCharm } from './additional-checkers.js';11describe(`${createCheckerFactory.name} integration`, () => {12 let createSut: () => CheckerFacade;13 let loggingContext: LoggingClientContext;14 let sut: CheckerFacade;15 let loggingServer: LoggingServer;16 let pluginModulePaths: string[];17 function rmSync(fileName: string) {18 if (fs.existsSync(fileName)) {19 fs.unlinkSync(fileName);20 }21 }22 beforeEach(async () => {23 // Make sure there is a logging server listening24 pluginModulePaths = [new URL('./additional-checkers.js', import.meta.url).toString()];25 loggingServer = new LoggingServer();26 const port = await loggingServer.listen();27 loggingContext = { port, level: LogLevel.Trace };28 createSut = testInjector.injector29 .provideValue(coreTokens.loggingContext, loggingContext)30 .provideValue(coreTokens.pluginModulePaths, pluginModulePaths)31 .injectFunction(createCheckerFactory);32 });33 afterEach(async () => {34 await sut.dispose?.();35 await loggingServer.dispose();36 rmSync(TwoTimesTheCharm.COUNTER_FILE);37 });38 async function arrangeSut(name: string): Promise<void> {39 testInjector.options.checkers = [name];40 sut = createSut();41 await sut.init?.();42 }43 it('should pass along the check result', async () => {44 const mutantRunPlan = factory.mutantRunPlan({ mutant: factory.mutant({ id: '1' }) });45 await arrangeSut('healthy');46 const expected: CheckResult = { status: CheckStatus.Passed };47 expect(await sut.check('healthy', [mutantRunPlan])).deep.eq([[mutantRunPlan, expected]]);48 });49 it('should reject when the checker behind rejects', async () => {50 await arrangeSut('crashing');51 await expect(sut.check('crashing', [factory.mutantRunPlan()])).rejectedWith('Always crashing');52 });53 it('should recover when the checker behind rejects', async () => {54 const mutantRunPlan = factory.mutantRunPlan();55 await fs.promises.writeFile(TwoTimesTheCharm.COUNTER_FILE, '0', 'utf-8');56 await arrangeSut('two-times-the-charm');57 const actual = await sut.check('two-times-the-charm', [mutantRunPlan]);58 const expected: CheckResult = { status: CheckStatus.Passed };59 expect(actual).deep.eq([[mutantRunPlan, expected]]);60 });61 it('should provide the nodeArgs', async () => {62 // Arrange63 const passingMutantRunPlan = factory.mutantRunPlan({ mutant: factory.mutant({ fileName: 'shouldProvideNodeArgs' }) });64 const failingMutantRunPlan = factory.mutantRunPlan({ mutant: factory.mutant({ fileName: 'somethingElse' }) });65 testInjector.options.checkerNodeArgs = ['--title=shouldProvideNodeArgs'];66 // Act67 await arrangeSut('verify-title');68 const passed = await sut.check('verify-title', [passingMutantRunPlan]);69 const failed = await sut.check('verify-title', [failingMutantRunPlan]);70 // Assert71 expect(passed).deep.eq([[passingMutantRunPlan, factory.checkResult({ status: CheckStatus.Passed })]]);72 expect(failed).deep.eq([[failingMutantRunPlan, factory.checkResult({ status: CheckStatus.CompileError })]]);73 });...

Full Screen

Full Screen

InitializeApplicationUseCase.es6

Source:InitializeApplicationUseCase.es6 Github

copy

Full Screen

1import {UseCase} from 'almin'2import * as actions from 'src/actions'3import {STORAGE_KEY_PREFERENCES} from 'src/constants'4import LoadTokensUseCase from 'src/usecases/LoadTokensUseCase'5import initializeDatabase from 'src/infra'6export default class InitializeApplicationUseCase extends UseCase {7 /**8 * Applicationの最初の初期化9 * @param {func} cb10 */11 async execute() {12 await initializeDatabase()13 // プラグインを読み込む14 const pluginModulePaths = (require('naumanniPlugins') || {}).default15 if(pluginModulePaths) {16 await Promise.all(17 Object.keys(pluginModulePaths).map((pluginId) => {18 return loadPlugin(pluginId, pluginModulePaths[pluginId])19 })20 )21 }22 // とりまべた書き23 // Preferencesを読み込む24 let preferences = {}25 try {26 preferences = JSON.parse(localStorage.getItem(STORAGE_KEY_PREFERENCES)) || {}27 } catch(e) {28 preferences = {}29 }30 this.dispatch({31 type: actions.PREFERENCES_LOADED,32 preferences,33 })34 // Tokenを読み込む35 await this.context.useCase(new LoadTokensUseCase()).execute()36 }37}38// TODO: そのうち plugin.es6みたいなところにうつす39async function loadPlugin(pluginId, module) {40 const {default: initializer} = module41 const api = new PluginAPI()42 const uiColumns = require('naumanni/pages/uiColumns').getColumnClasses()43 const uiComponents = require('naumanni/pages/uiComponents')44 return initializer({45 api,46 uiColumns,47 uiComponents,48 })49}50import request from 'superagent'51import {getServerRoot} from 'src/config'52class PluginAPI {53 /**54 * pluginのAPIへの呼び出しを作成する55 * @param {string} method56 * @param {string} plugin57 * @param {string} api58 * @return {Request}59 */60 makePluginRequest(method, plugin, api) {61 if(!api.startsWith('/')) {62 throw new Error('api must starts with /')63 }64 // TODO: apply server authorization65 return request(method, `${getServerRoot()}api/plugins/${plugin}${api}`)66 }...

Full Screen

Full Screen

checker-factory.ts

Source:checker-factory.ts Github

copy

Full Screen

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

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const pluginModulePaths = require('stryker-parent').pluginModulePaths;2const plugins = pluginModulePaths('stryker-*');3const pluginLoader = require('stryker-parent').pluginLoader;4const plugins = pluginLoader('stryker-*');5const pluginLoader = require('stryker-parent').pluginLoader;6const plugins = pluginLoader('stryker-*');7const pluginLoader = require('stryker-parent').pluginLoader;8const plugins = pluginLoader('stryker-*');9const pluginLoader = require('stryker-parent').pluginLoader;10const plugins = pluginLoader('stryker-*');11const pluginLoader = require('stryker-parent').pluginLoader;12const plugins = pluginLoader('stryker-*');13const pluginLoader = require('stryker-parent').pluginLoader;14const plugins = pluginLoader('stryker-*');15const pluginLoader = require('stryker-parent').pluginLoader;16const plugins = pluginLoader('stryker-*');17const pluginLoader = require('stryker-parent').pluginLoader;18const plugins = pluginLoader('stryker-*');19const pluginLoader = require('stryker-parent').pluginLoader;20const plugins = pluginLoader('stryker-*');21const pluginLoader = require('stryker-parent').pluginLoader;22const plugins = pluginLoader('stryker-*');23const pluginLoader = require('stryker-parent').pluginLoader;24const plugins = pluginLoader('stryker-*');25const pluginLoader = require('stryker-parent').pluginLoader;26const plugins = pluginLoader('stryker-*');27const pluginLoader = require('stryker-parent').pluginLoader;28const plugins = pluginLoader('stryker-*');

Full Screen

Using AI Code Generation

copy

Full Screen

1var pluginModulePaths = require('stryker-parent').pluginModulePaths;2var plugins = pluginModulePaths('stryker-*');3console.log(plugins);4var pluginModulePaths = require('stryker-parent').pluginModulePaths;5var plugins = pluginModulePaths('stryker-*');6console.log(plugins);7var pluginModulePaths = require('stryker-parent').pluginModulePaths;8var plugins = pluginModulePaths('stryker-*');9console.log(plugins);10var pluginModulePaths = require('stryker-parent').pluginModulePaths;11var plugins = pluginModulePaths('stryker-*');12console.log(plugins);13var pluginModulePaths = require('stryker-parent').pluginModulePaths;14var plugins = pluginModulePaths('stryker-*');15console.log(plugins);16var pluginModulePaths = require('stryker-parent').pluginModulePaths;17var plugins = pluginModulePaths('stryker-*');18console.log(plugins);19var pluginModulePaths = require('stryker-parent').pluginModulePaths;20var plugins = pluginModulePaths('stryker-*');21console.log(plugins);22var pluginModulePaths = require('stryker-parent').pluginModulePaths;

Full Screen

Using AI Code Generation

copy

Full Screen

1var pluginModulePaths = require('stryker-parent').pluginModulePaths;2var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));3var pluginModulePaths = require('stryker').pluginModulePaths;4var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));5var pluginModulePaths = require('stryker-api').pluginModulePaths;6var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));7var pluginModulePaths = require('stryker-parent').pluginModulePaths;8var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));9var pluginModulePaths = require('stryker').pluginModulePaths;10var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));11var pluginModulePaths = require('stryker-api').pluginModulePaths;12var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));13var pluginModulePaths = require('stryker-parent').pluginModulePaths;14var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));15var pluginModulePaths = require('stryker').pluginModulePaths;16var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));17var pluginModulePaths = require('stryker-api').pluginModulePaths;18var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));19var pluginModulePaths = require('stryker-parent').pluginModulePaths;20var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));21var pluginModulePaths = require('stryker').pluginModulePaths;22var myPlugin = require(pluginModulePaths('stryker-mocha-framework'));

Full Screen

Using AI Code Generation

copy

Full Screen

1var stryker = require('stryker');2var pluginModulePaths = stryker.pluginModulePaths;3var modulePaths = pluginModulePaths('stryker-*');4console.log(modulePaths);5module.exports = function(config) {6 config.set({7 });8};9var stryker = require('stryker');10var pluginModulePaths = stryker.pluginModulePaths;11var modulePaths = pluginModulePaths('stryker-*');12console.log(modulePaths);13module.exports = function(config) {14 config.set({15 });16};

Full Screen

Using AI Code Generation

copy

Full Screen

1var pluginModulePaths = require('stryker-parent').pluginModulePaths;2module.exports = {3 createReporter: function () {4 return {5 onRunComplete: function () {6 console.log('my-custom-module is working!');7 }8 }9 }10};11module.exports = function (config) {12 config.set({13 });14};15var pluginModulePaths = require('stryker-parent').pluginModulePaths;16module.exports = {17 createReporter: function () {18 var reporters = pluginModulePaths('stryker-*', 'my-custom-module').map(require);19 return {20 onRunComplete: function () {21 reporters.forEach(function (reporter) {22 reporter.onRunComplete();23 });24 }25 }26 }27};28module.exports = function (config) {29 config.set({30 });31};

Full Screen

Using AI Code Generation

copy

Full Screen

1const pluginModulePaths = require('stryker-parent').pluginModulePaths;2const pluginPaths = pluginModulePaths('stryker-javascript-mutator');3const plugins = pluginPaths.map(require);4const pluginModulePaths = require('stryker-parent').pluginModulePaths;5const pluginPaths = pluginModulePaths('stryker-javascript-mutator');6const plugins = pluginPaths.map(require);7const pluginModulePaths = require('stryker-parent').pluginModulePaths;8const pluginPaths = pluginModulePaths('stryker-javascript-mutator');9const plugins = pluginPaths.map(require);10const pluginModulePaths = require('stryker-parent').pluginModulePaths;11const pluginPaths = pluginModulePaths('stryker-javascript-mutator');12const plugins = pluginPaths.map(require);13const pluginModulePaths = require('stryker-parent').pluginModulePaths;14const pluginPaths = pluginModulePaths('stryker-javascript-mutator');15const plugins = pluginPaths.map(require);16const pluginModulePaths = require('stryker-parent').pluginModulePaths;17const pluginPaths = pluginModulePaths('stryker-javascript-mutator');

Full Screen

Using AI Code Generation

copy

Full Screen

1const { pluginModulePaths } = require('stryker-parent');2const jestRunnerPath = pluginModulePaths('stryker-jest-runner');3const JestRunner = require(jestRunnerPath);4const runner = new JestRunner();5runner.runMutationTest({ files: ['file1.js', 'file2.js'], mutate: ['file1.js'] });6const { PluginKind } = require('stryker-api/plugin');7const { Runner } = require('stryker-api/test_runner');8const { testInjector } = require('stryker-api/test_utils');9class JestRunner extends Runner {10 constructor(options) {11 super();12 this.options = options;13 }14 runMutant(mutant) {15 }16 dispose() {17 }18}19JestRunner.inject = testInjector.inject;20JestRunner[PluginKind.TestRunner] = 'jest';21module.exports = JestRunner;

Full Screen

Using AI Code Generation

copy

Full Screen

1const strykerParent = require('stryker-parent');2const pluginModulePaths = strykerParent.pluginModulePaths();3console.log(pluginModulePaths);4const pluginModulePaths = strykerParent.pluginModulePaths('stryker-mocha-framework');5console.log(pluginModulePaths);6const pluginModulePaths = strykerParent.pluginModulePaths('stryker-mocha-framework', 'mocha');7console.log(pluginModulePaths);8const pluginModulePaths = strykerParent.pluginModulePaths('stryker-mocha-framework', 'mocha', 'lodash');9console.log(pluginModulePaths);10const pluginModulePaths = strykerParent.pluginModulePaths('stryker-mocha-framework', 'mocha', 'lodash', 'loglevel');11console.log(pluginModulePaths);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stryker-parent automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful