While unit testing in actionscript-3
with mockolate
I have run into quite a few problems/errors:
Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]
Error: 1 unmet Expectation
Mockolate errors and debugging are poorly documented and searches bring up no results, so solving these problems get very tricky.
No expectation defined error is thrown when the function you are testing expects the specified invocation type and name:
Can be solved with:
Unmet expectation error can be thrown when you created a mock statement (a
getter
orsetter
) but there is nogetter
orsetter
defined for the variable you aregetting
orsetting
.Can be solved with: