sinonjs / sinon

Test spies, stubs and mocks for JavaScript.
https://sinonjs.org/
Other
9.6k stars 769 forks source link

sinon-test is broken when using sinon v17.0.2 #2597

Closed john-mills-nz closed 1 month ago

john-mills-nz commented 1 month ago

Describe the bug After upgrading sinon to v17.0.2 sinon-test stops working. The error TypeError: this.stub is not a function occurs. Reverting to v17.0.1 fixes it.

To Reproduce Steps to reproduce the behavior:

  1. Update to v17.0.2
  2. Run tests
  3. See error
fatso83 commented 1 month ago

Thanks for posting. The change that affects you is probably https://github.com/sinonjs/sinon/commit/93db3ef3b0b49458954eb6e7ed765aa1ea34b21d, which ~was supposed to be non-breaking, as mentioned in the commit~ was explicitly noted as breaking, without my checking the changelog before releasing a new version. I need to look into what is breaking before fixing, as I don't really see why ATM, but it's probably the defaultConfig that was removed.

To unblock people, I reverted the latest tag to point to the previous release on the NPM registry. You will need to remove node_modules to get that.

fatso83 commented 1 month ago

This is fixed in sinon-test 3.1.6 in commit https://github.com/sinonjs/sinon-test/commit/cd5164987d3705208bebee1b291797d87b090220