Files
ruflo/tests/fixtures/generators.ts
T
rUvandClaude 63d391e10b 🚀 Release: Claude Flow v2.0.0-alpha.62
## 🔒 Security Fixes
- CRITICAL: Removed vulnerable pkg dependency (GHSA-22r3-9w55-cj54)
- Replaced with secure @vercel/ncc alternative
- Security score improved from 55/100 to 75/100
- All npm audit vulnerabilities resolved (0 vulnerabilities)

## 🚀 Infrastructure Improvements
- Re-enabled ALL CI/CD security gates with strict enforcement
- Fixed Jest configuration and test infrastructure
- Fixed 18 TypeScript test files with import issues
- Created comprehensive test utilities

## 🛠️ Code Quality
- Fixed 145 ESLint errors (16% reduction)
- Fixed 15 critical TypeScript errors
- Added development tooling configs

## 📚 Documentation
- Created security audit report
- Created fix summary documentation
- Created functionality review
- Updated GitHub issue #362

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 13:35:41 +00:00

93 lines
2.2 KiB
TypeScript

// Test data generators
export function generateCoordinationTasks(count: number) {
return Array.from({ length: count }, (_, i) => ({
id: `task-${i}`,
priority: ['low', 'medium', 'high', 'critical'][Math.floor(Math.random() * 4)],
requiredResources: [`resource-${i % 3}`],
estimatedDuration: Math.random() * 1000
}));
}
export function generateMemoryEntries(count: number) {
const namespaces = ['test', 'production', 'staging', 'development'];
const tags = ['important', 'urgent', 'archive', 'temporary', 'cached'];
return Array.from({ length: count }, (_, i) => ({
namespace: namespaces[i % namespaces.length],
key: `entry-${i}`,
value: {
id: i,
data: `Test data ${i}`,
metadata: {
created: new Date().toISOString(),
source: 'generator',
index: i
}
},
tags: tags.filter(() => Math.random() > 0.5)
}));
}
export function generateErrorScenarios() {
return [
{
name: 'network-timeout',
error: new Error('Network timeout'),
recoverable: true
},
{
name: 'invalid-input',
error: new TypeError('Invalid input type'),
recoverable: false
},
{
name: 'resource-exhausted',
error: new Error('Resource exhausted'),
recoverable: true
},
{
name: 'permission-denied',
error: new Error('Permission denied'),
recoverable: false
}
];
}
export function generateEdgeCaseData() {
return {
strings: {
empty: '',
veryLong: 'x'.repeat(10000),
unicode: '🚀🎭🌍',
specialChars: '!@#$%^&*()_+-=[]{}|;:\'",.<>?/\\',
whitespace: ' \t\n\r '
},
numbers: {
zero: 0,
negative: -1,
infinity: Infinity,
negativeInfinity: -Infinity,
nan: NaN,
maxSafeInt: Number.MAX_SAFE_INTEGER,
minSafeInt: Number.MIN_SAFE_INTEGER
},
objects: {
null: null,
undefined: undefined,
empty: {},
nested: { a: { b: { c: { d: 'deep' } } } },
circular: (() => {
const obj: any = { a: 1 };
obj.self = obj;
return obj;
})()
},
arrays: {
empty: [],
sparse: [1, , , 4],
mixed: [1, 'two', { three: 3 }, [4]],
large: Array(1000).fill(0)
}
};
}