How to use mutation-testing-metrics - 3 common examples

To help you get started, we’ve selected a few mutation-testing-metrics 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 / core / src / reporters / ClearTextReporter.ts View on Github external
public onMutationTestReportReady(report: mutationTestReportSchema.MutationTestResult) {
    const metricsResult = calculateMetrics(report.files);
    this.writeLine(new ClearTextScoreTable(metricsResult, this.options.thresholds).draw());
  }
}
github stryker-mutator / stryker / e2e / helpers.ts View on Github external
export async function readMutationTestResult(eventResultDirectory = path.resolve('reports', 'mutation', 'events')) {
  const allReportFiles = await fsAsPromised.readdir(eventResultDirectory);
  const mutationTestReportFile = allReportFiles.find(file => !!file.match(/.*onMutationTestReportReady.*/));
  expect(mutationTestReportFile).ok;
  const mutationTestReportContent = await fsAsPromised.readFile(path.resolve(eventResultDirectory, mutationTestReportFile || ''), 'utf8');
  const report = JSON.parse(mutationTestReportContent) as mutationTestReportSchema.MutationTestResult;
  const metricsResult = calculateMetrics(report.files);
  return metricsResult;
}
github stryker-mutator / stryker / packages / core / src / reporters / dashboard-reporter / DashboardReporter.ts View on Github external
private toReport(result: mutationTestReportSchema.MutationTestResult): Report {
    if (this.options.dashboard.reportType === ReportType.Full) {
      return result;
    } else {
      return {
        mutationScore: calculateMetrics(result.files).metrics.mutationScore
      };
    }
  }

mutation-testing-metrics

Utility functions to calculate mutation testing metrics.

Apache-2.0
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Popular mutation-testing-metrics functions

Similar packages