test: align js validator use-section rules

This commit is contained in:
sck_0
2026-02-02 21:37:05 +01:00
parent 2070a91ef7
commit 3d6c75d37f
2 changed files with 177 additions and 138 deletions

View File

@@ -0,0 +1,16 @@
const assert = require('assert');
const { hasUseSection } = require('../validate-skills');
const samples = [
['## When to Use', true],
['## Use this skill when', true],
['## When to Use This Skill', true],
['## Overview', false],
];
for (const [heading, expected] of samples) {
const content = `\n${heading}\n- item\n`;
assert.strictEqual(hasUseSection(content), expected, heading);
}
console.log('ok');