// chai-change plugin doesn't seem to work anymore (chaijs/chai-change#4)
Seems like assertChanges in assertions.js expects object, prop. It limits the usage of this kind of assertion, as I can't do:
assert.increases(
someOperation,
() => getSomething().length
)
It's good in cases I use immutable data, and getSomething returns different object completely.
RSpec's change matcher has this feature, it can get either an object and a method name or a function for more arbitrary operations.
https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/change-matcher
//
chai-changeplugin doesn't seem to work anymore (chaijs/chai-change#4)Seems like
assertChangesinassertions.jsexpectsobject, prop. It limits the usage of this kind of assertion, as I can't do:It's good in cases I use immutable data, and
getSomethingreturns different object completely.RSpec's
changematcher has this feature, it can get either an object and a method name or a function for more arbitrary operations.https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/change-matcher