chai-spies: Incompatibility with chai@4
chai version: 4.0.0 chai-spies version: 0.7.1 Node.js version: 7.10.0
expect(spy).to.be.called.with(...) fails with:
Error: Invalid Chai property: _his. Did you mean "is"?
at Object.proxyGetter [as get] (node_modules/chai/lib/chai/utils/proxify.js:63:17)
at Proxy.assertWith (node_modules/chai-spies/lib/spy.js:283:29)
at Proxy.chainableMethodWrapper (node_modules/chai/lib/chai/utils/addChainableMethod.js:113:49)
Besides that, if this is a breaking change in the public API for plugin authors, it should probably have been mentioned in the release notes for chai@4.0.0.
Thanks!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (4 by maintainers)
Commits related to this issue
- :sparkles:(asyncs) support async service with asyncs array, :bug:(chai) 0.7.1 https://github.com/chaijs/chai-spies/issues/71, use master — committed to whatwewant/dva-socket.io by whatwewant 7 years ago
- Fix most of the tests Remove chai-spies as its not being maintained properly https://github.com/chaijs/chai-spies/issues/71 — committed to hmcts/cmc-citizen-frontend by deleted user 7 years ago
- Use spies to test whether function is called #125 Please note, that: * cannot use chai-spies due to https://github.com/chaijs/chai-spies/issues/71 * async calls to next won't be detected, just as t... — committed to hypescript/authmosphere by deleted user 7 years ago
So according to the linked issue, only the master branch of this plugin is working. The tagged npm release 0.7.1 is not. Can we get a release to bump or are we all forced to tag this package to master?
"chai-spies": "git://github.com/chaijs/chai-spies.git#master"or if you like to lock it to current HEAD:
"chai-spies": "git://github.com/chaijs/chai-spies.git#b11aeebf"can we get a quick bump to 0.7.2 with current master? locking package at certain commit/branch breaks our deploy 😞
You’re a hero, @shellscape
I’ve published
chai-spies-nextfor those who want a dep not linked to master (in case of breaking changes). Toss me into the pile of users that are surprised with slight historical mismanagement of this repo/module.@meeber right now manually release. I’m working on a PR to get it in-line with
deep-eql,check-erroretc - so that it’ll be an auto-release with semver. Same for chai-http and others. Hope to put something up before MondayPing @keithamus Just wanted to remind the maintainers that despite this bug being marked as fixed back in June there is still no published version that includes the fix.
Could probably switch to SinonJS easily enough. API seems similar. Anyone tried this?
Update: https://github.com/domenic/sinon-chai Update: For anyone interested in migrating to sinon - it was pretty straightforward, can probably even be done with autoreplace. It’s fully compatible, no issues with chai v4.
@tindn regarding this error, I believe we should be able to just update the package from the npm registry on Sunday, yay.
I’d open a new issue for the second one, let’s keep this thread on-topic. Such thing tend to become lost if they aren’t in an appropriate place, especially given that I’m going to go ahead and close this issue as it is actually resolved now (well, not yet completely, but the release is scheduled, so there’s no point in keeping this on the backlog).