Skip to content

expectDecision beta ​

Function of @v12-engine/engine/testing

ts
export declare function expectDecision(report: AiReport, goal: string, options?: {
    picked?: boolean;
}): GoalReport;

Says that a goal runs, as of a report (thinkOnce, Brain.report): it is picked and holds what it claimed. Throws where it does not, with its row in words (Brain.explain): what each consideration answered and what kept it out. Gives the goal's row. With picked: false, says it does not run

expectDecision(thinkOnce(world, ENEMY), 'ai.defend')