@flamesshield/rules-engine
Version:
Independent rules engine for security analysis of Firebase
54 lines • 2.39 kB
TypeScript
import { EnrichedProjectInformation, ProjectInformation, StaticRule } from '../types/index.js';
/**
* Factory class for creating standardized test data across the rules engine test suite.
* Provides consistent methods for creating EnrichedProjectInformation, StaticRule objects,
* and other test fixtures with sensible defaults and easy customization.
*/
export declare class TestDataFactory {
/**
* Creates a basic ProjectInformation object with minimal required fields
*/
static createBaseProjectInfo(overrides?: Partial<ProjectInformation>): ProjectInformation;
/**
* Creates an EnrichedProjectInformation object with computed properties
*/
static createEnrichedProjectInfo(overrides?: Partial<ProjectInformation>): Promise<EnrichedProjectInformation>;
/**
* Creates a ProjectInformation object configured for AppCheck testing
*/
static createProjectInfoWithAppCheck(appCheckEnabled?: boolean, overrides?: Partial<ProjectInformation>): Promise<EnrichedProjectInformation>;
/**
* Creates a ProjectInformation object configured for Authentication testing
*/
static createProjectInfoWithAuth(authEnabled?: boolean, overrides?: Partial<ProjectInformation>): Promise<EnrichedProjectInformation>;
/**
* Creates a basic StaticRule object for testing
*/
static createStaticRule(overrides?: Partial<StaticRule>): StaticRule;
/**
* Creates an AppCheck-specific rule for testing
*/
static createAppCheckRule(overrides?: Partial<StaticRule>): StaticRule;
/**
* Creates an Authentication-specific rule for testing
*/
static createAuthRule(overrides?: Partial<StaticRule>): StaticRule;
/**
* Creates a collection of test rules for comprehensive testing
*/
static createTestRuleSet(): StaticRule[];
/**
* Creates mock data for edge cases and error scenarios
*/
static createEdgeCaseProjectInfo(scenario: 'empty' | 'invalid' | 'missing-fields'): Partial<ProjectInformation>;
/**
* Creates a rule execution context for testing
*/
static createRuleExecutionContext(projectInfo: EnrichedProjectInformation, rules?: StaticRule[]): {
projectInfo: EnrichedProjectInformation;
rules: StaticRule[];
executionId: string;
timestamp: string;
};
}
//# sourceMappingURL=TestDataFactory.d.ts.map