mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-18 22:25:44 +01:00
Answer product-owner round 1: 0 🔴, 1 🟡 (0 misread); the README names the memory a mutation run needs, and a RuntimeError lists its mutants and the likely cause
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import config from './stryker.config.mjs'
|
||||
|
||||
const mutants = Object.values(JSON.parse(readFileSync(config.jsonReporter.fileName, 'utf8')).files).flatMap((file) => file.mutants)
|
||||
const errors = mutants.filter((mutant) => mutant.status === 'RuntimeError').length
|
||||
if (errors > 0) {
|
||||
console.error(`${errors} of ${mutants.length} mutants ended as RuntimeError, so each may hide a survivor`)
|
||||
const files = Object.entries(JSON.parse(readFileSync(config.jsonReporter.fileName, 'utf8')).files)
|
||||
const mutants = files.flatMap(([path, file]) => file.mutants.map((mutant) => ({ ...mutant, path })))
|
||||
const errors = mutants.filter((mutant) => mutant.status === 'RuntimeError')
|
||||
if (errors.length > 0) {
|
||||
console.error(`${errors.length} of ${mutants.length} mutants ended as RuntimeError, so each may hide a survivor. A test run killed for lack of memory ends so:`)
|
||||
for (const mutant of errors) console.error(` ${mutant.path}:${mutant.location.start.line} ${mutant.mutatorName}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user