<commit_before>import {TestRunner, RunResult as RunResult, TestResult} from '../../../src/api/test_runner';
import {StrykerOptions} from '../../../src/api/core';
import {expect} from 'chai';

class MyTestRunner extends TestRunner {

  public run(): Promise<RunResult> {
    return new Promise<RunResult>(res => res({
      specNames: [''],
      succeeded: 5,
      failed: 6,
      result: TestResult.Complete,
      timeSpent: 20,
      coverage: {
        '': {
          statementMap: {
            '5': { start: { line: 23, column: 23 }, end: { line: 23, column: 23 } },
          },
          s: {
            '5': 23
          }
        }
      }
    }));
  }

  public getOptions() {
    return this.options;
  }
}

describe('TestRunner', () => {

  let sut: TestRunner,
    options: StrykerOptions;

  before(() => {
    options = { karma: { 'my-karma-options': {} } };
    sut = new MyTestRunner({ sourceFiles: [], additionalFiles: [], strykerOptions: null, port: 58 });
  });

  it('should supply options', () => {
    expect((<MyTestRunner>sut).getOptions()).to.be.eq(options);
  });

  it('should run', () => {
    expect(sut.run({ timeout: 5000 })).to.be.ok;
  });

});<commit_msg>Updated api unit test for test runner to allow for new constructor<commit_after>import {TestRunner, RunResult as RunResult, TestResult} from '../../../src/api/test_runner';
import {StrykerOptions} from '../../../src/api/core';
import {expect} from 'chai';

class MyTestRunner extends TestRunner {

  public run(): Promise<RunResult> {
    return new Promise<RunResult>(res => res({
      specNames: [''],
      succeeded: 5,
      failed: 6,
      result: TestResult.Complete,
      timeSpent: 20,
      coverage: {
        '': {
          statementMap: {
            '5': { start: { line: 23, column: 23 }, end: { line: 23, column: 23 } },
          },
          s: {
            '5': 23
          }
        }
      }
    }));
  }

  public getOptions() {
    return this.options;
  }
}

describe('TestRunner', () => {

  let sut: TestRunner,
    strykerOptions: StrykerOptions;

  before(() => {
    strykerOptions = { karma: { 'my-karma-options': {} } };
    sut = new MyTestRunner({ sourceFiles: [], additionalFiles: [], strykerOptions, port: 58 });
  });

  it('should supply options', () => {
    expect((<MyTestRunner>sut).getOptions().strykerOptions).to.be.eq(strykerOptions);
  });

  it('should run', () => {
    expect(sut.run({ timeout: 5000 })).to.be.ok;
  });

});
{'fraction_non_alphanumeric': 0.18358269308532146, 'fraction_numerical': 0.017792155276991507, 'mean_word_length': 2.4553072625698324, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3494955', 'n_tokens_mistral': 844, 'n_tokens_neox': 797, 'n_words': 180}