mutation-testing-metrics
Advanced tools
Comparing version 1.7.6 to 1.7.8
@@ -6,2 +6,21 @@ # Change Log | ||
## [1.7.8](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.7.7...v1.7.8) (2021-12-09) | ||
**Note:** Version bump only for package mutation-testing-metrics | ||
## [1.7.7](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.7.6...v1.7.7) (2021-12-09) | ||
### Performance Improvements | ||
* **metrics:** use Map for fast testId -> TestModel lookup ([dfca0bc](https://github.com/stryker-mutator/mutation-testing-elements/commit/dfca0bcc5033daee9227a9bce1bab2a4da556313)) | ||
## [1.7.6](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.7.5...v1.7.6) (2021-11-19) | ||
@@ -8,0 +27,0 @@ |
@@ -91,16 +91,20 @@ "use strict"; | ||
function relate(mutants, tests) { | ||
var _a, _b; | ||
var _a, _b, _c, _d; | ||
// Create a testId -> TestModel map for fast lookup | ||
const testMap = new Map(tests.map((test) => [test.id, test])); | ||
for (const mutant of mutants) { | ||
if (mutant.coveredBy || mutant.killedBy) { | ||
for (const test of tests) { | ||
if ((_a = mutant.coveredBy) === null || _a === void 0 ? void 0 : _a.includes(test.id)) { | ||
mutant.addCoveredBy(test); | ||
test.addCovered(mutant); | ||
} | ||
if ((_b = mutant.killedBy) === null || _b === void 0 ? void 0 : _b.includes(test.id)) { | ||
mutant.addKilledBy(test); | ||
test.addKilled(mutant); | ||
} | ||
const coveringTests = (_b = (_a = mutant.coveredBy) === null || _a === void 0 ? void 0 : _a.map((testId) => testMap.get(testId))) !== null && _b !== void 0 ? _b : []; | ||
for (const test of coveringTests) { | ||
if (test) { | ||
mutant.addCoveredBy(test); | ||
test.addCovered(mutant); | ||
} | ||
} | ||
const killingTests = (_d = (_c = mutant.killedBy) === null || _c === void 0 ? void 0 : _c.map((testId) => testMap.get(testId))) !== null && _d !== void 0 ? _d : []; | ||
for (const test of killingTests) { | ||
if (test) { | ||
mutant.addKilledBy(test); | ||
test.addKilled(mutant); | ||
} | ||
} | ||
} | ||
@@ -107,0 +111,0 @@ } |
{ | ||
"name": "mutation-testing-metrics", | ||
"version": "1.7.6", | ||
"version": "1.7.8", | ||
"description": "Utility functions to calculate mutation testing metrics.", | ||
@@ -21,4 +21,5 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"mutation-testing-report-schema": "1.7.6" | ||
} | ||
"mutation-testing-report-schema": "1.7.8" | ||
}, | ||
"gitHead": "38c8eaec008ed148223efde4ec5d0545fce1b6ba" | ||
} |
@@ -8,3 +8,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) | ||
See [mutant states and metrics in the Stryker handbook](https://github.com/stryker-mutator/stryker-handbook/blob/master/mutant-states-and-metrics.md#readme) for more details about mutation testing metrics. | ||
See [mutant states and metrics on the Stryker website](https://stryker-mutator.io/docs/mutation-testing-elements/mutant-states-and-metrics/) for more details about mutation testing metrics. | ||
@@ -11,0 +11,0 @@ ## Usage example |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
59874
40
890
0
+ Addedmutation-testing-report-schema@1.7.8(transitive)
- Removedmutation-testing-report-schema@1.7.6(transitive)