/** * QA360 Fixtures Module * * P0: Reusable test data and factory functions * - Factories for creating test entities * - Fake data generation * - Seeded random for deterministic tests */ /** * Factory options */ export interface FactoryOptions { /** Optional overrides for default values */ overrides?: Record; /** Optional relationships to other entities */ relations?: Record; } /** * Base factory interface */ export interface Factory { build(options?: FactoryOptions): T; buildMany(count: number, options?: FactoryOptions): T[]; } /** * User entity factory */ export interface User { id?: string; username: string; email: string; password: string; firstName?: string; lastName?: string; role?: 'user' | 'admin' | 'moderator'; active?: boolean; createdAt?: Date; } /** * Test result factory */ export interface TestResult { id?: string; name: string; status: 'passed' | 'failed' | 'skipped'; duration: number; error?: string; } /** * API response factory */ export interface ApiResponse { status: number; data?: unknown; error?: string; headers?: Record; } /** * User Factory */ export declare class UserFactory implements Factory { private static counter; build(options?: FactoryOptions): User; buildMany(count: number, options?: FactoryOptions): User[]; /** * Create an admin user */ admin(options?: FactoryOptions): User; /** * Create an inactive user */ inactive(options?: FactoryOptions): User; } /** * Test Result Factory */ export declare class TestResultFactory implements Factory { private static counter; build(options?: FactoryOptions): TestResult; buildMany(count: number, options?: FactoryOptions): TestResult[]; /** * Create a passed test */ passed(options?: FactoryOptions): TestResult; /** * Create a failed test */ failed(options?: FactoryOptions): TestResult; /** * Create a skipped test */ skipped(options?: FactoryOptions): TestResult; } /** * API Response Factory */ export declare class ApiResponseFactory implements Factory { build(options?: FactoryOptions): ApiResponse; buildMany(count: number, options?: FactoryOptions): ApiResponse[]; /** * Create a success response */ success(data?: unknown, options?: FactoryOptions): ApiResponse; /** * Create an error response */ error(status?: number, message?: string, options?: FactoryOptions): ApiResponse; /** * Create a not found response */ notFound(options?: FactoryOptions): ApiResponse; /** * Create an unauthorized response */ unauthorized(options?: FactoryOptions): ApiResponse; } /** * Fake data generator with seeded random */ export declare class FakeData { private static seed; /** * Set the seed for deterministic random generation */ static setSeed(seed: number): void; /** * Seeded random number generator (Mulberry32) */ private static random; /** * Generate a random integer between min and max (inclusive) */ static integer(min: number, max: number): number; /** * Generate a random float between min and max */ static float(min: number, max: number): number; /** * Generate a random string */ static string(length?: number, charset?: string): string; /** * Generate a random email */ static email(): string; /** * Generate a random URL */ static url(): string; /** * Generate a random UUID v4 */ static uuid(): string; /** * Generate a random date */ static date(minYear?: number, maxYear?: number): Date; /** * Generate a random boolean */ static boolean(): boolean; /** * Pick a random element from an array */ static pick(array: T[]): T; /** * Generate a random name */ static name(): string; /** * Generate a random paragraph */ static paragraph(sentences?: number): string; } /** * Convenience functions */ export declare const userFactory: UserFactory; export declare const testResultFactory: TestResultFactory; export declare const apiResponseFactory: ApiResponseFactory;