From e23406f440f0c78d300a6269804a6e4d2f3e2a29 Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Thu, 28 Apr 2022 23:54:23 -0700 Subject: [PATCH] Add brief note about `.always` prefix (#153) This is the only instance (besides the `not` methods) where we don't just tack the method name on the end, so it seems worth a call-out, as it has already confused at least two people per https://github.com/domenic/sinon-chai/issues/139 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b0d977..5e601c7 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ For more information on the behavior of each assertion, see [the documentation for the corresponding spy methods][spymethods]. These of course work on not only spies, but individual spy calls, stubs, and mocks as well. -Note that you can negate any assertion with Chai's `.not`. E. g. for `notCalled` use `spy.should.have.not.been.called`. +Note that you can negate any assertion with Chai's `.not`. E. g. for `notCalled` use `spy.should.have.not.been.called`. Similarly, note that the `always` methods are accessed with Chai's `.always` prefix; `should.have.been.alwaysCalledWith` will not work - instead, use `should.always.have.been.calledWith`. For simplicity, this library intentionally only implements Sinon's spy methods, and does not add an interface for `Sinon.assert.match`. Sinon's matchers are implemented by the `samsam` library, so if you want a should/expect interface to `assert.match` you may be interested in [chai-samsam](https://www.chaijs.com/plugins/chai-samsam/), which adds a `.deep.match` verb that will work with Sinon matchers.