mutation-testing-metrics-scala
Advanced tools
Comparing version 1.4.4 to 1.5.0
@@ -6,2 +6,20 @@ # Change Log | ||
# [1.5.0](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.4.4...v1.5.0) (2020-12-23) | ||
### Features | ||
* **metrics-scala:** add support for test coverage and metadata ([#816](https://github.com/stryker-mutator/mutation-testing-elements/issues/816)) ([580f34a](https://github.com/stryker-mutator/mutation-testing-elements/commit/580f34abc1d9e01f055be8b42bc4fb6ee4d3cf3c)) | ||
* **metrics-scala:** align naming of types with schema ([#810](https://github.com/stryker-mutator/mutation-testing-elements/issues/810)) ([f47af3e](https://github.com/stryker-mutator/mutation-testing-elements/commit/f47af3eb28beae9d4792c9360d40f1149d9e456f)) | ||
### BREAKING CHANGES | ||
* **metrics-scala:** MutationTestReport was renamed to MutationTestResult | ||
* **metrics-scala:** MutationTestResult was renamed to FileResult | ||
## [1.4.4](https://github.com/stryker-mutator/mutation-testing-elements/compare/v1.4.3...v1.4.4) (2020-11-04) | ||
@@ -8,0 +26,0 @@ |
{ | ||
"name": "mutation-testing-metrics-scala", | ||
"version": "1.4.4", | ||
"version": "1.5.0", | ||
"description": "Zero-dependency library to calculate mutation testing metrics in Scala.", | ||
"scripts": { | ||
"test": "sbt \"+compile; test\"", | ||
"test": "sbt \"+compile; test; docs/mdoc --check\"", | ||
"prepublishOnly": "sbt +publishSigned", | ||
@@ -21,3 +21,3 @@ "publish": "sbt sonatypeBundleRelease", | ||
"homepage": "https://github.com/stryker-mutator/mutation-testing-elements/tree/master/packages/mutation-testing-metrics-scala#readme", | ||
"gitHead": "91830e71633cbc748cde2d2dbcd78f22e668995d" | ||
"gitHead": "9a4a0f3424edb5fc7de4a38987fe03b80db657d7" | ||
} |
@@ -26,5 +26,5 @@ [![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-scala)](https://badge-api.stryker-mutator.io/github.com/stryker-mutator/mutation-testing-elements/master?module=metrics-scala) | ||
import mutationtesting._ | ||
val report = MutationTestReport(thresholds = Thresholds(high = 80, low = 10), | ||
val report = MutationTestResult(thresholds = Thresholds(high = 80, low = 10), | ||
files = Map( | ||
"src/stryker4s/Stryker4s.scala" -> MutationTestResult( | ||
"src/stryker4s/Stryker4s.scala" -> FileResult( | ||
source = "case class Stryker4s(foo: String)", | ||
@@ -39,3 +39,3 @@ mutants = Seq( | ||
The `MutationTestReport` case classes generate a JSON compliant with the [mutation-testing JSON schema](https://github.com/stryker-mutator/mutation-testing-elements/blob/master/packages/mutation-testing-report-schema/src/mutation-testing-report-schema.json). | ||
The `MutationTestResult` case classes generate a JSON compliant with the [mutation-testing JSON schema](https://github.com/stryker-mutator/mutation-testing-elements/blob/master/packages/mutation-testing-report-schema/src/mutation-testing-report-schema.json). | ||
@@ -68,22 +68,13 @@ | ||
### Encoding | ||
### Encoding & decoding | ||
Import the encoder: | ||
Import the codec: | ||
```scala | ||
import io.circe.syntax._ | ||
import mutationtesting.MutationReportEncoder._ | ||
import mutationtesting.circe._ | ||
val encoded: io.circe.Json = report.asJson | ||
``` | ||
### Decoding | ||
Import the decoder: | ||
```scala | ||
import io.circe.parser.decode | ||
import mutationtesting.MutationReportDecoder._ | ||
val decoded: Either[io.circe.Error, MutationTestReport] = decode[MutationTestReport](json) | ||
val decoded: Either[io.circe.Error, MutationTestResult] = decode[MutationTestResult](encoded.toString) | ||
``` | ||
@@ -90,0 +81,0 @@ |
22571
132