From aba48f90f1763b649938133c18aab54fb05f1684 Mon Sep 17 00:00:00 2001 From: Zied Jlassi <6190550+zied-jlassi@users.noreply.github.com> Date: Sat, 20 Jun 2026 14:38:38 +0200 Subject: [PATCH] test(validate-skills): document test helpers with JSDoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added JSDoc to the test/assert/hasTriggerFinding helpers so the new test file documents its own helpers. No behaviour change — the suite still passes 3/3. --- test/test-validate-skills.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/test-validate-skills.js b/test/test-validate-skills.js index 64bb3a858..ddc518c59 100644 --- a/test/test-validate-skills.js +++ b/test/test-validate-skills.js @@ -26,6 +26,11 @@ let totalTests = 0; let passedTests = 0; const failures = []; +/** + * Run a single named test case, recording the result and printing a status line. + * @param {string} name - Human-readable test description. + * @param {Function} fn - Test body; throw to signal failure. + */ function test(name, fn) { totalTests++; try { @@ -38,11 +43,21 @@ function test(name, fn) { } } +/** + * Throw an Error with `message` when `condition` is falsy. + * @param {boolean} condition - Expression that must hold. + * @param {string} message - Failure message. + */ function assert(condition, message) { if (!condition) throw new Error(message); } -// True when validateSkill emitted the SKILL-06 "Use when/Use if" trigger finding. +/** + * Whether validateSkill emitted the SKILL-06 "Use when/Use if" trigger finding + * for the given fixture skill directory. + * @param {string} skillName - Fixture subdirectory name under FIXTURES. + * @returns {boolean} True if the trigger-phrase finding was reported. + */ function hasTriggerFinding(skillName) { const findings = validateSkill(path.join(FIXTURES, skillName)); return findings.some((f) => f.rule === 'SKILL-06' && /trigger phrase/i.test(f.detail));