fix(e2e): fail when database setup runs no tests
Some checks failed
ci / verify (push) Has been cancelled
ci / format (push) Has been cancelled
ci / e2e (push) Has been cancelled
ci / windows (push) Has been cancelled
ci / docker-build (push) Has been cancelled

This commit is contained in:
Ochenstarik 2026-09-30 21:15:33 +07:00
parent 0910afd54d
commit 14d200851b

View file

@ -52,6 +52,16 @@ try {
console.error('[run-e2e] нет JSON-результатов: стенд не поднялся (см. e2e-run.txt)'); console.error('[run-e2e] нет JSON-результатов: стенд не поднялся (см. e2e-run.txt)');
process.exit(1); process.exit(1);
} }
const assertionCount = results.testResults?.reduce(
(total, file) => total + (file.assertionResults?.length ?? 0),
0,
);
if (!assertionCount) {
console.error(
`[run-e2e] тесты не выполнены (vitest exit=${exitCode}): стенд не поднялся или global setup завершился ошибкой`,
);
process.exit(1);
}
const known = strict const known = strict
? {} ? {}
: JSON.parse(readFileSync(path.join(repoRoot, 'tests/e2e/known-defects.json'), 'utf8')).defects; : JSON.parse(readFileSync(path.join(repoRoot, 'tests/e2e/known-defects.json'), 'utf8')).defects;