mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-03 23:53:29 +08:00
fix: clamp progressBar to prevent RangeError on overflow, add 10 tests
progressBar() in skill-create-output.js could crash with RangeError when percent > 100 because repeat() received a negative count. Fixed by clamping filled to [0, width]. New tests: - progressBar edge cases: 0%, 100%, and >100% confidence - Empty patterns/instincts arrays - post-edit-format: null tool_input, missing file_path, prettier failure - setup-package-manager: --detect output completeness, current marker
This commit is contained in:
@@ -159,6 +159,22 @@ function runTests() {
|
||||
assert.ok(result.stdout.includes('pnpm'));
|
||||
})) passed++; else failed++;
|
||||
|
||||
// --detect output completeness
|
||||
console.log('\n--detect output completeness:');
|
||||
|
||||
if (test('shows all three command types in detection output', () => {
|
||||
const result = run(['--detect']);
|
||||
assert.strictEqual(result.code, 0);
|
||||
assert.ok(result.stdout.includes('Install:'), 'Should show Install command');
|
||||
assert.ok(result.stdout.includes('Run script:'), 'Should show Run script command');
|
||||
assert.ok(result.stdout.includes('Execute binary:'), 'Should show Execute binary command');
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('shows current marker for active package manager', () => {
|
||||
const result = run(['--detect']);
|
||||
assert.ok(result.stdout.includes('(current)'), 'Should mark current PM');
|
||||
})) passed++; else failed++;
|
||||
|
||||
// Summary
|
||||
console.log(`\nResults: Passed: ${passed}, Failed: ${failed}`);
|
||||
process.exit(failed > 0 ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user