UNPKG

@stryker-mutator/core

Version:

The extendable JavaScript mutation testing framework

27 lines 1.15 kB
import { expect } from 'chai'; import { factory } from '@stryker-mutator/test-helpers'; import { TestRunnerDecorator } from '../../../src/test-runner/test-runner-decorator.js'; describe('TestRunnerDecorator', () => { let sut; let testRunner; beforeEach(() => { testRunner = factory.testRunner(); sut = new TestRunnerDecorator(() => testRunner); }); function actArrangeAssert(methodName) { describe(methodName, () => { it('should pass through resolved results', () => { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument testRunner[methodName].resolves('some value'); return expect(sut[methodName]()).to.eventually.eq('some value'); }); it('should pass through rejected results', () => { testRunner[methodName].rejects(new Error('some error')); return expect(sut[methodName]()).to.be.rejectedWith('some error'); }); }); } actArrangeAssert('dryRun'); actArrangeAssert('mutantRun'); }); //# sourceMappingURL=test-runner-decorator.spec.js.map