/
githubmirror
/
Front-End-Checklist
Обзор
Документация
Войти
/
githubmirror
/
Front-End-Checklist
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
scripts/guide-structure/__tests__/guide-structure.test.ts
50 строк
808 B
David Dias
chore: new v2 version
30 май 2026, 00:54
30 май 2026, 00:54
7c05904
Код
Авторство
О чём код?
import assert from 'node:assert/strict' import test from 'node:test' import { analyzeGuideStructure } from '../../lib/guide-structure' test('canonical how-to guide structure passes', () => { const issues = analyzeGuideStructure( 'how-to', ` Intro paragraph. ## TL;DR ## Before You Start ## Steps ### Step 1 ## Examples ## Common Mistakes ## Verification ## Related Checklist ` ) assert.equal(issues.length, 0) }) test('insight guide fails when sections are missing or out of order', () => { const issues = analyzeGuideStructure( 'insight', ` Intro paragraph. ## Argument ## Context ## Practical Takeaway ## Related Checklist ` ) assert.ok(issues.some(issue => issue.code === 'missing-section')) assert.ok(issues.some(issue => issue.code === 'section-order')) })