Files
ruflo/v2/tests/integration/hook-basic.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

56 lines
1.7 KiB
JavaScript

/**
* Basic hook functionality tests
*/
import { describe, it, expect } from '@jest/globals';
describe('Hook Basic Tests', () => {
it('should pass basic test', () => {
expect(true).toBe(true);
});
it('should handle hook parameters', () => {
const options = {
'validate-safety': true,
'prepare-resources': false
};
const validateSafety = options['validate-safety'] || options.validate || false;
const prepareResources = options['prepare-resources'] || false;
expect(validateSafety).toBe(true);
expect(prepareResources).toBe(false);
});
it('should map file extensions to agents', () => {
const getAgentTypeFromFile = (filePath) => {
const ext = filePath.split('.').pop().toLowerCase();
const agentMap = {
'js': 'javascript-developer',
'ts': 'typescript-developer',
'py': 'python-developer',
'go': 'golang-developer',
'md': 'technical-writer',
'yml': 'devops-engineer',
'yaml': 'devops-engineer'
};
return agentMap[ext] || 'general-developer';
};
expect(getAgentTypeFromFile('test.js')).toBe('javascript-developer');
expect(getAgentTypeFromFile('test.py')).toBe('python-developer');
expect(getAgentTypeFromFile('test.unknown')).toBe('general-developer');
});
it('should detect dangerous commands', () => {
const dangerousCommands = ['rm -rf', 'format', 'del /f', 'rmdir /s', 'dd if='];
const isDangerous = (command) => {
return dangerousCommands.some(cmd => command.includes(cmd));
};
expect(isDangerous('rm -rf /')).toBe(true);
expect(isDangerous('echo hello')).toBe(false);
expect(isDangerous('format c:')).toBe(true);
});
});