UNPKG

1.4 kBTypeScriptView Raw
1import { Goal } from "../../api/goal/Goal";
2import { ExecuteGoal } from "../../api/goal/GoalInvocation";
3import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent";
4import { SoftwareDeliveryMachineConfiguration } from "../../api/machine/SoftwareDeliveryMachineOptions";
5/**
6 * Enum to describe goal sizes when creating mock goal executors
7 */
8export declare enum MockGoalSize {
9 Small = 5,
10 Medium = 20,
11 Large = 60,
12 ExtraLarge = 90
13}
14/**
15 * Options to configure mocks for one particular goal
16 */
17export interface MockGoal {
18 goal: Goal;
19 size: MockGoalSize | number;
20 result?: number;
21 mock?: ExecuteGoal;
22}
23/**
24 * Options for the mock goal executor support
25 */
26export interface MockOptions {
27 enabled: boolean | ((goal: SdmGoalEvent) => boolean);
28 defaultSize?: MockGoalSize | number;
29 goals?: MockGoal[];
30 randomBy?: number;
31}
32/**
33 * Default mock options to be merged into custom options provided on configuration.sdm.mock
34 */
35export declare const DefaultMockOptions: MockOptions;
36/**
37 * Create mock goal executor for a certain goal
38 * @param goal
39 * @param configuration
40 */
41export declare function mockGoalExecutor(goal: Goal, sdmGoal: SdmGoalEvent, configuration: SoftwareDeliveryMachineConfiguration): ExecuteGoal | undefined;
42export declare function randomize(size: MockGoalSize | number, randomBy: number): number;
43//# sourceMappingURL=mock.d.ts.map
\No newline at end of file