mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-08-28 05:25:25 +00:00
- 59 test files covering unit and integration tests - vitest config with coverage thresholds and fork pooling - Test fixtures (mini-repo + multi-language sample code) - Add vitest + coverage-v8 to devDependencies - Add test scripts (test, test:integration, test:all, test:watch, test:coverage) - Move typescript to devDependencies where it belongs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
545 B
TypeScript
27 lines
545 B
TypeScript
export interface UserConfig {
|
|
name: string;
|
|
email: string;
|
|
active: boolean;
|
|
}
|
|
|
|
export function validateUser(config: UserConfig): boolean {
|
|
return config.name.length > 0 && config.email.includes('@');
|
|
}
|
|
|
|
export class UserService {
|
|
private users: UserConfig[] = [];
|
|
|
|
addUser(user: UserConfig): void {
|
|
if (validateUser(user)) {
|
|
this.users.push(user);
|
|
}
|
|
}
|
|
|
|
getUser(name: string): UserConfig | undefined {
|
|
return this.users.find(u => u.name === name);
|
|
}
|
|
}
|
|
|
|
function internalHelper(): string {
|
|
return 'helper';
|
|
}
|