mutation-testing-metrics
Advanced tools
Comparing version 1.7.4 to 1.7.5
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.7.5](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.7.4...v1.7.5) (2021-08-01) | ||
### Features | ||
* **metrics:** add `aggregateResultsByModule` function ([#1225](https://github.com/stryker-mutator/mutation-testing-elements/issues/1225)) ([bb690b8](https://github.com/stryker-mutator/mutation-testing-elements/commit/bb690b8ce8588a42ab8b0d4967b2b52e2c769b7a)) | ||
## [1.7.4](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.7.3...v1.7.4) (2021-07-13) | ||
@@ -8,0 +19,0 @@ |
import { MetricsResult } from '../model/metrics-result'; | ||
export declare function normalizeFileNames<TIn>(input: Record<string, TIn>, projectRoot?: string): Record<string, TIn>; | ||
export declare function normalize<TIn, TOut>(input: Record<string, TIn>, projectRoot: string, factory: (input: TIn, relativeFileName: string) => TOut): Record<string, TOut>; | ||
export declare function determineCommonBasePath(fileNames: ReadonlyArray<string>): string; | ||
export declare function compareNames(a: MetricsResult<any, any>, b: MetricsResult<any, any>): number; | ||
//# sourceMappingURL=file.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.compareNames = exports.normalize = exports.normalizeFileNames = void 0; | ||
exports.compareNames = exports.determineCommonBasePath = exports.normalize = exports.normalizeFileNames = void 0; | ||
const SEPARATOR = '/'; | ||
@@ -40,2 +40,3 @@ function normalizeFileNames(input, projectRoot = '') { | ||
} | ||
exports.determineCommonBasePath = determineCommonBasePath; | ||
function compareNames(a, b) { | ||
@@ -42,0 +43,0 @@ const sortValue = (metricsResult) => { |
export * from './group-by'; | ||
export * from './file'; | ||
export * from './text'; | ||
export * from './is-not-nullish'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -16,2 +16,3 @@ "use strict"; | ||
__exportStar(require("./text"), exports); | ||
__exportStar(require("./is-not-nullish"), exports); | ||
//# sourceMappingURL=index.js.map |
export { calculateMetrics, calculateMutationTestMetrics } from './calculateMetrics'; | ||
export { aggregateResultsByModule } from './aggregate'; | ||
export { normalizeFileNames } from './helpers'; | ||
export { MetricsResult, Metrics, TestMetrics, TestModel, FileUnderTestModel, TestFileModel, MutantModel, MutationTestMetricsResult, TestStatus, } from './model'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TestStatus = exports.MutantModel = exports.TestFileModel = exports.FileUnderTestModel = exports.TestModel = exports.normalizeFileNames = exports.calculateMutationTestMetrics = exports.calculateMetrics = void 0; | ||
exports.TestStatus = exports.MutantModel = exports.TestFileModel = exports.FileUnderTestModel = exports.TestModel = exports.normalizeFileNames = exports.aggregateResultsByModule = exports.calculateMutationTestMetrics = exports.calculateMetrics = void 0; | ||
var calculateMetrics_1 = require("./calculateMetrics"); | ||
Object.defineProperty(exports, "calculateMetrics", { enumerable: true, get: function () { return calculateMetrics_1.calculateMetrics; } }); | ||
Object.defineProperty(exports, "calculateMutationTestMetrics", { enumerable: true, get: function () { return calculateMetrics_1.calculateMutationTestMetrics; } }); | ||
var aggregate_1 = require("./aggregate"); | ||
Object.defineProperty(exports, "aggregateResultsByModule", { enumerable: true, get: function () { return aggregate_1.aggregateResultsByModule; } }); | ||
var helpers_1 = require("./helpers"); | ||
@@ -8,0 +10,0 @@ Object.defineProperty(exports, "normalizeFileNames", { enumerable: true, get: function () { return helpers_1.normalizeFileNames; } }); |
{ | ||
"name": "mutation-testing-metrics", | ||
"version": "1.7.4", | ||
"version": "1.7.5", | ||
"description": "Utility functions to calculate mutation testing metrics.", | ||
@@ -22,4 +22,3 @@ "main": "dist/src/index.js", | ||
"mutation-testing-report-schema": "1.7.4" | ||
}, | ||
"gitHead": "6efdfe3d48712ff800bc096c8d1c22756185c464" | ||
} | ||
} |
@@ -15,3 +15,3 @@ [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fstryker-mutator%2Fmutation-testing-elements%2Fmaster%3Fmodule%3Dmetrics)](https://badge-api.stryker-mutator.io/github.com/stryker-mutator/mutation-testing-elements/master?module=metrics) | ||
```ts | ||
import { MetricsResult, calculateMetrics } from 'mutation-testing-metrics'; | ||
import { MetricsResult, calculateMutationTestMetrics } from 'mutation-testing-metrics'; | ||
import { MutationTestResult } from 'mutation-testing-report-schema'; | ||
@@ -23,3 +23,3 @@ | ||
const result: MetricsResult = calculateMetrics(mutationTestReport); | ||
const result: MetricsResult = calculateMutationTestMetrics(mutationTestReport); | ||
@@ -31,26 +31,24 @@ console.log('Mutation score', result.metrics.mutationScore); | ||
### `calculateMutationTestMetrics` [`(MutationTestResult) => MutationTestMetricsResult`] | ||
Calculates the full mutation test metrics from both the files-under-test as well as (optionally) the test files. | ||
The input is a mutation test result valid according to the [https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/report-schema#readme] | ||
Returns A `MutationTestMetricsResult` that contains both the `systemUnderTestMetrics` as well as the `testMetrics` | ||
### `calculateMetrics` [`(MutationTestResult) => MetricsResult`] | ||
Calculates the metrics for a MutationTestResult. This result must be valid according to the [https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/report-schema#readme]. | ||
Calculates the files-under-test metrics inside of a mutation testing report. | ||
### `MetricsResult` | ||
The input is a mutation test result valid according to the [https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/report-schema#readme] | ||
A `MetricsResult` has a `metrics` property containing the following metrics: | ||
### `aggregateResultsByModule` [`(Record<string, MutationTestResult>) => MutationTestResult`] | ||
- `killed` | ||
- `timeout` | ||
- `survived` | ||
- `noCoverage` | ||
- `runtimeErrors` | ||
- `compileErrors` | ||
- `ignored` | ||
- `totalDetected` | ||
- `totalUndetected` | ||
- `totalValid` | ||
- `totalInvalid` | ||
- `mutationScore` | ||
- `totalMutants` | ||
- `mutationScoreBasedOnCoveredCode` | ||
Aggregates multiple reports together into a single report, grouped by module. | ||
It optionally has a `file` property which points to a `FileResult` (mutation-testing-report-schema) or one or more `childResults` | ||
if it represents a directory. | ||
Input: `resultsByModule` The MutationTestResult objects by module name. | ||
### Types | ||
Types are included and documented with TypeScript. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39
884
47270
52