Open Bug 1400194 Opened 2 years ago Updated 2 years ago
Consider changing how tests work with sinon to not include the version number everywhere
We've currently got around 12 files that are including sinon-2.3.2.js, that number is likely to get bigger. When we update sinon, we'll have to update each location where it is included. I think we should either: a) Change how sinon is included, so that we can reference just "sinon.js", b) Load sinon by default in mochitests. Doing b) would also make it more accessible and easier to use, so that might be a bigger bonus. Thoughts are welcome.
My only concern here is that it may make updating sinon difficult if the upgrade requires changing the tests themselves, whereas the current strategy means you could pick and choose what tests use an updated version. Bug 1369855 suffered a little from this moving from 1.6 to 2.3.2 - and I guess bumping major versions is where that is most likely. OTOH though, I do feel your pain, so I'm unlikely to actually object to either of your 2 proposals.
I think we'll always end up having multiple concurrent versions of sinon if somehow other major versions are released: We can imagine that in the future, if more and more tests use that library, it will be even harder to migrate all tests to the new flavor of sinon. I would suggest making it simpler to include sinon in tests, only keeping the major version (e.g sinon-2.js)
Making it trivial to use for mochitests sounds like it will help simplify tests as it spreads, which could be a big win. That said, if at some point we do need to support multiple versions, I could even imagine mochitest defaulting to a specific version, and have some way to override that (maybe using a naming scheme as :eoger suggests).
You need to log in before you can comment on or make changes to this bug.