-
-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an assertion that checks how much a value has changed. #330
Comments
Hey again @oveddan! Thanks for the issue! Could you explain a little further, maybe with more examples, why this should be added? In your example, I don't see why I would do that, when I could just do:
|
👍 I had been wanting this for a while and was surprised it's not part of the lib... pull request: #333
var car = new Car(...);
car.accelerate.should.change(car, 'speed');
car.accelerate.should.increase(car, 'speed');
car.fillGasTank.should.not.change(car, 'oil');
car.addGallonOfGas.should.change(car, 'gas').by(1); |
@cmpolis Thanks for doing this! Yeah @keithamus it is especially useful for testing operations that change the quantity of a persisted value, in particular when you don't know the original value that was changed. |
Added `change`, `increase` and `decrease` assertions with `by` chain (#330)
This would be used to check if, when something is invoked, something else is changed by x.
For example:
I'd be glad to take a stab at this.
The text was updated successfully, but these errors were encountered: