-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Upgrading from 5.0.10 to 5.1.0 breaks existing tests: "TypeError: sinon_1.spy is not a function" #1828
Comments
Quite sure this is related to this #1805 (comment). I see that you are using TypeScript, in which case, it's the TypeScript bindings that are breaking with the new ES6 module support. We have no official support for those typings. Closing on those grounds, but discussion is encouraged .. |
I don't use TypeScript just "standard" ES6 via webpacker/babel and it's still broken: https://travis-ci.org/ujh/fountainpencompanion/jobs/389076772 |
@ujh We ship a common js Now that we actually do support using Sinon as a EcmaScript module, we will look into issues when it breaks - given the new |
@fatso83 I'm not entirely sure I understand the changes. If the current state is how you think it should be, that's completely fine. All else aside, this is a breaking change. That should at the very least be a major version bump, wouldn't you agree? Then it won't silently break existing apps - that's the point of semver. I would say the best solution here is to revert the changes in a patch release |
@fkleuver There are two different aspects here: what is the correct and what would be the best thing for our users. There is no breaking change with regards to what we support. We don't support Babel, Webpack, Typescript, Rollup, etc. It works, but how it works and how to fix that when it does, is outside of our scope. Up until now, we support using Sinon as a browser bundle and we support using it as a common js module. So if you managed to use it in other environments, great! But again, not something we support explicitly. If anything is a breaking change, it is that it either an API change, Sinon fails to load in a browser or Sinon fails to work in Node. Not working with bundlers: meh. That covers the first aspect: onto the second one. Knowing that a lot of projects nowadays use transpilers and bundlers, and that this issue and other show that it breaks, I could be inclined to say that it is in the interest of our users to drop the semantics, New Jersey style, and do as you said: revert the commit for 5.x (seperate branch), publish the patch, ship a major version with the module to avoid our users needing to fix their code. Input, @mroderick? |
I have prepared the necessary changes on a separate branch. I would just need to |
@fatso83 I appreciate you taking the time to explain and considering this. I got a little worried reading this comment I understand the reasoning - you'd have to release every feature and bugfix as a breaking change if you wanted to be 100% sure to never break any potential thing. However given the immense popularity of TypeScript and webpack, and the overall idea of trying your best as a library to not surprise users, it can't hurt to occasionally take the safe route and do a major bump for some large feature. Especially with a library that has so many dependents and is so intertwined with often complex testing stacks. Certainly romantic versioning is not an option then :) It's completely fine and understandable if you don't anticipate this as a library developer. It would be unreasonable to expect that of you. Now that it's been pointed out, there's something you can do though. I just so happened to figure this out because I was able to take the time to compare two lockfiles and go through the changes one by one until I found the cause. These issues are very difficult to track down when you have so many moving parts. It was sinon now, but it might have been a thousand other things. Others might be losing days on it because they're got no clue what's going on. I promise you, that's happening. |
Describe the bug
Existing tests using
spy
fail withTypeError: sinon_1.spy is not a function
.This is since 5.1.0 (it quietly slipped in because I'm not using a lockfile at the moment.)
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/aurelia/experiment
cd experiment
yarn install
npm run test
yarn add [email protected] -D
npm run test
Expected behavior
Only 1 test should be failing instead of 25 :)
Context
Using a fairly large stack of libraries. I tried to create a repro with only the bare minimum, but then I got different errors (could not resolve
chai
), hence I'm referencing the full repo of where the error surfaced.It should contain all the information you need, but I'd be happy to help with further debugging / fixing the issue if you wish. Just let me know.
Many thanks!
The text was updated successfully, but these errors were encountered: