From 14d200851b05f14add47b31f43fea83d5ef2d5c1 Mon Sep 17 00:00:00 2001 From: Ochenstarik Date: Wed, 30 Sep 2026 21:15:33 +0700 Subject: [PATCH] fix(e2e): fail when database setup runs no tests --- scripts/test/run-e2e.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/test/run-e2e.mjs b/scripts/test/run-e2e.mjs index d202643..2a00bdc 100644 --- a/scripts/test/run-e2e.mjs +++ b/scripts/test/run-e2e.mjs @@ -52,6 +52,16 @@ try { console.error('[run-e2e] нет JSON-результатов: стенд не поднялся (см. e2e-run.txt)'); 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 ? {} : JSON.parse(readFileSync(path.join(repoRoot, 'tests/e2e/known-defects.json'), 'utf8')).defects;