Pass instructions to executor constructor

This commit is contained in:
Guillaume Beraudo
2018-11-16 12:36:50 +01:00
parent ce44a9a3e4
commit 81d0bc21d5
6 changed files with 57 additions and 62 deletions

View File

@@ -28,10 +28,9 @@ function createContext() {
function executeInstructions(builder, expectedDrawTextImageCalls, expectedReplayImageCalls) {
const transform = createTransform();
const context = createContext();
const executor = new InstructionExecutor(1, [-180, -90, 180, 90], 0.02, 1, null);
const executor = new InstructionExecutor(1, [-180, -90, 180, 90], 0.02, 1, false, null, builder.finish());
sinon.spy(executor, 'drawTextImageWithPointPlacement_');
const replayImageStub = sinon.stub(executor, 'replayImage_');
executor.replaceInstructions(builder.finish());
executor.execute(context, transform);
expect(executor.drawTextImageWithPointPlacement_.callCount).to.be(expectedDrawTextImageCalls);
expect(replayImageStub.callCount).to.be(expectedReplayImageCalls);