Files
privacy.sexy/tests/unit/shared/Stubs/ExpressionParserStub.ts
undergroundwires 803ef2bb3e Move stubs from ./stubs to ./shared/Stubs
Gathers all shared test code in single place.
2022-01-25 08:37:03 +01:00

19 lines
576 B
TypeScript

import { IExpression } from '@/application/Parser/Script/Compiler/Expressions/Expression/IExpression';
import { IExpressionParser } from '@/application/Parser/Script/Compiler/Expressions/Parser/IExpressionParser';
export class ExpressionParserStub implements IExpressionParser {
public callHistory = new Array<string>();
private result: IExpression[] = [];
public withResult(result: IExpression[]) {
this.result = result;
return this;
}
public findExpressions(code: string): IExpression[] {
this.callHistory.push(code);
return this.result;
}
}