Files
ruflo/v2/tests/unit/fix-typos-syntax.test.js
T
rUvandClaude Opus 4.5 1b6a1971f7 feat(v3): add comprehensive v3 implementation plans and swarm architecture
- Reorganize v3/ into implementation/ subfolders:
  - planning/, architecture/, migration/, integration/
  - security/, adrs/, research/, swarm-plans/

- Add 15-agent concurrent swarm implementation plans:
  - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases
  - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities
  - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology
  - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x)
  - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback
  - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies

- Update .claude/settings.json with proper hooks format
- Add bash aliases for claude --dangerously-skip-permissions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 15:40:51 +00:00

61 lines
2.5 KiB
JavaScript

// Test file to verify typo and syntax fixes
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
describe('Typo and Syntax Fixes', () => {
describe('daa-tools.js processCommunication fix', () => {
test('should have fixed processCommuncation to processCommunication', () => {
const filePath = path.join(process.cwd(), 'src/ui/console/js/daa-tools.js');
const fileContent = fs.readFileSync(filePath, 'utf-8');
// Check that the typo has been fixed
expect(fileContent).not.toContain('processCommuncation');
expect(fileContent).toContain('processCommunication');
// Check method definition exists
const methodMatch = fileContent.match(/processCommunication\s*\([^)]*\)\s*{/);
expect(methodMatch).toBeTruthy();
// Check method call exists
const callMatch = fileContent.match(/this\.processCommunication\s*\(/);
expect(callMatch).toBeTruthy();
});
});
describe('sparc-commands.js ternary operator check', () => {
test('should have properly formatted ternary operators', () => {
const filePath = path.join(process.cwd(), 'src/cli/simple-commands/init/claude-commands/sparc-commands.js');
const fileContent = fs.readFileSync(filePath, 'utf-8');
// Check that the ternary operator on line 6-8 is complete
const ternaryMatch = fileContent.match(/mode\.roleDefinition\.length > 100\s*\?\s*`[^`]+`\s*:\s*mode\.roleDefinition/);
expect(ternaryMatch).toBeTruthy();
// Check that Array.isArray ternary is complete (has the : 'None' part)
// The pattern is: Array.isArray(mode.groups) ? ... : 'None'}
const arrayTernaryPattern = /Array\.isArray\(mode\.groups\)\s*\?[\s\S]+?\)\s*:\s*'None'\}/;
const arrayTernaryMatch = fileContent.match(arrayTernaryPattern);
expect(arrayTernaryMatch).toBeTruthy();
});
test('should be valid JavaScript syntax', async () => {
const filePath = path.join(process.cwd(), 'src/cli/simple-commands/init/claude-commands/sparc-commands.js');
// Dynamic import to check syntax
let imported;
try {
imported = await import(filePath);
expect(imported).toBeDefined();
expect(typeof imported.createSparcSlashCommand).toBe('function');
} catch (error) {
// If import fails, it's a syntax error
throw new Error(`Syntax error in sparc-commands.js: ${error.message}`);
}
});
});
});