Move stubs from ./stubs to ./shared/Stubs
Gathers all shared test code in single place.
This commit is contained in:
18
tests/unit/shared/Stubs/ExpressionParserStub.ts
Normal file
18
tests/unit/shared/Stubs/ExpressionParserStub.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user