How to use the @stryker-mutator/api/test_runner.TestStatus.Success 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 / test-helpers / src / factory.ts View on Github external
export const testResult = factoryMethod(() => ({
  name: 'name',
  status: TestStatus.Success,
  timeSpentMs: 10
}));
github stryker-mutator / stryker / packages / core / src / test-runner / CommandTestRunner.ts View on Github external
function completeResult(exitCode: number | null, timer: Timer): RunResult {
        const duration = timer.elapsedMs();
        if (exitCode === 0) {
          return {
            status: RunStatus.Complete,
            tests: [
              {
                name: 'All tests',
                status: TestStatus.Success,
                timeSpentMs: duration
              }
            ]
          };
        } else {
          return {
            status: RunStatus.Complete,
            tests: [
              {
                failureMessages: [output.map(buf => buf.toString()).join(os.EOL)],
                name: 'All tests',
                status: TestStatus.Failed,
                timeSpentMs: duration
              }
            ]
          };
github stryker-mutator / stryker / packages / karma-runner / src / StrykerReporter.ts View on Github external
public readonly onSpecComplete = (_browser: any, spec: KarmaSpec) => {
    const name = spec.suite.reduce((name, suite) => name + suite + ' ', '') + spec.description;
    let status = TestStatus.Failed;
    if (spec.skipped) {
      status = TestStatus.Skipped;
    } else if (spec.success) {
      status = TestStatus.Success;
    }
    const testResult: TestResult = {
      failureMessages: spec.log,
      name,
      status,
      timeSpentMs: spec.time
    };
    this.emit('test_result', testResult);
  };
github stryker-mutator / stryker / packages / mocha-runner / src / StrykerMochaReporter.ts View on Github external
this.runner.on('pass', (test: any) => {
      this.runResult.tests.push({
        name: test.fullTitle(),
        status: TestStatus.Success,
        timeSpentMs: this.timer.elapsedMs()
      });
      this.passedCount++;
      this.timer.reset();
    });
github stryker-mutator / stryker / packages / jest-runner / src / JestTestRunner.ts View on Github external
private determineTestResultStatus(status: string) {
    switch (status) {
      case 'passed':
        return TestStatus.Success;
      case 'pending':
        return TestStatus.Skipped;
      case 'todo':
        return TestStatus.Skipped;
      default:
        return TestStatus.Failed;
    }
  }
}
github stryker-mutator / stryker / packages / wct-runner / src / WctReporter.ts View on Github external
private toTestResultStatus(state: CompletedState): TestStatus {
    switch (state) {
      case 'failing':
        return TestStatus.Failed;
      case 'passing':
        return TestStatus.Success;
      default:
        return TestStatus.Skipped;
    }
  }
}
github stryker-mutator / stryker / packages / jasmine-runner / src / helpers.ts View on Github external
export function toStrykerTestResult(specResult: jasmine.CustomReporterResult, timeSpentMs: number): TestResult {
  let status = TestStatus.Failed;
  let failureMessages: string[] | undefined;
  if (specResult.status === 'disabled' || specResult.status === 'pending' || specResult.status === 'excluded') {
    status = TestStatus.Skipped;
  } else if (!specResult.failedExpectations || specResult.failedExpectations.length === 0) {
    status = TestStatus.Success;
  } else {
    failureMessages = specResult.failedExpectations.map(failedExpectation => failedExpectation.message);
  }
  return {
    failureMessages,
    name: specResult.fullName,
    status,
    timeSpentMs
  };
}