feat: журнал тестирования, бэклог идей; V.2 hasAnyAttemptForTest + unit tests; ссылки в спринтах

Made-with: Cursor
This commit is contained in:
Константин Лебединский
2026-04-24 19:26:02 +05:00
parent 4eeb3fbc62
commit e87168d3a0
9 changed files with 247 additions and 4 deletions
@@ -0,0 +1,23 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { hasAnyAttemptForTest } from './testChainService.js';
test('hasAnyAttemptForTest: false, если в базе пусто', async () => {
const pool = {
async query() {
return { rows: [{ has_any: false }] };
},
};
const result = await hasAnyAttemptForTest(pool, '00000000-0000-0000-0000-000000000001');
assert.equal(result, false);
});
test('hasAnyAttemptForTest: true, если есть попытка', async () => {
const pool = {
async query() {
return { rows: [{ has_any: true }] };
},
};
const result = await hasAnyAttemptForTest(pool, '00000000-0000-0000-0000-000000000001');
assert.equal(result, true);
});