mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
test: распознавать исполнившийся subtest в outcome (#550)
Issue: #550 User-Visible: no
This commit is contained in:
@@ -90,7 +90,7 @@ const ORACLE_SETUP_FAILURE = new RegExp([
|
||||
// Test frameworks include user/fixture text in failure diagnostics. A fixture
|
||||
// may literally mention ERR_MODULE_NOT_FOUND, so a proven assertion failure
|
||||
// must win over a setup-looking substring quoted inside that assertion.
|
||||
const ASSERTION_EVIDENCE = /(?:ERR_ASSERTION|AssertionError|^FAILED\s+\S+)/im;
|
||||
const ASSERTION_EVIDENCE = /(?:ERR_ASSERTION|AssertionError|^FAILED\s+\S+|^# Subtest:|^✖\s+)/im;
|
||||
|
||||
export function classifyCommandResult(result, { phase = 'oracle', proof = MUTATION_PROOF.ASSERTION } = {}) {
|
||||
const stopped = interruption(result);
|
||||
|
||||
@@ -61,6 +61,23 @@ test('#550 fixture: real named assertion failure is reusable proof', () => {
|
||||
});
|
||||
assert.equal(quotedFixture.kind, MUTATION_OUTCOME.ASSERTION_KILLED,
|
||||
'слово из fixture внутри AssertionError не маскирует реальное падение теста');
|
||||
const runtimeEnoent = runGuardPhases('node --test ledger.test.mjs', {
|
||||
execute: () => result(1, [
|
||||
'# Subtest: ledger writes immediately',
|
||||
'not ok 1 - ledger writes immediately',
|
||||
"error: ENOENT: no such file or directory, open 'ledger.json'",
|
||||
].join('\n')),
|
||||
});
|
||||
assert.equal(runtimeEnoent.kind, MUTATION_OUTCOME.ASSERTION_KILLED,
|
||||
'ошибка поведения внутри исполнившегося subtest не становится setup failure');
|
||||
const specReporter = runGuardPhases('node --test ledger.test.mjs', {
|
||||
execute: () => result(1, [
|
||||
'✖ ledger writes immediately (2ms)',
|
||||
"Error: ENOENT: no such file or directory, open 'ledger.json'",
|
||||
].join('\n')),
|
||||
});
|
||||
assert.equal(specReporter.kind, MUTATION_OUTCOME.ASSERTION_KILLED,
|
||||
'node spec reporter также доказывает, что именованный test исполнился');
|
||||
});
|
||||
|
||||
test('#550 fixture: green named assertion means the mutant survived', () => {
|
||||
|
||||
Reference in New Issue
Block a user