ryanplusplus / mach.js

Simple mocking framework for JavaScript inspired by CppUMock and designed for readability
MIT License
5 stars 2 forks source link

Verify that multiply nested expectations work #12

Closed ryanplusplus closed 8 years ago

ryanplusplus commented 8 years ago

It seems that this works:

blah.shouldBeCalled()
  .andThen(blah.shouldBeCalled())
  .and(blah.shouldBeCalled());

but this doesn't:

blah.shouldBeCalled()
  .andThen(blah.shouldBeCalled()
    .and(blah.shouldBeCalled()
  )
);

The ordering for the second case gets mangled and strict ordering is applied to everything after the first andThen instead of just the call that was andThened.