import { AnswersQuestions, Interaction, Question } from '..'; export type Assertion = (actual: A) => void; export class See extends Interaction { static if(question: Question, assertion: Assertion) { return new See(question, assertion); } constructor( private question: Question, private assert: Assertion, ) { super(); } performAs(actor: AnswersQuestions): PromiseLike { return actor.answer(this.question).then(this.assert); } toString = () => `#actor checks ${this.question}`; }