-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fake timers #315
Fake timers #315
Conversation
I haven't done this upgrade because this would be a major version bump, as we're exposing the underlying |
Yeah, I think this would require a major version bump as @sinonjs/fake-timers has dropped support for node 8. Many libraries are dropping support for node 10 already, but since this is only dropping support for node 8 which was last updated on 2019 I personally think the benefits of upgrading our stack vs maintaining support for node 8 are greater. As a user of kefir and its related tools, I would like to see a bigger community so that more people are testing the code we use every day, I believe one way to achieve that is to constantly update the libraries and keep issues/PRs tidy. |
Fair. I don't use Kefir as much as I used to, but I would be open to refreshing the testing utilities and it's related suite of tools. The only issue is I don't think there's a good reason to release a major version of Kefir, and if we drop Node 8 & 10 support in KTU, then we'll probs need to drop support for (or at least stop testing) those versions, which is a major version bump. At that point, there are a handful of breaking changes we may want to consider as well, and now we're starting to unravel things a bit. So that's why I haven't really bothered with all of this. |
In theory, KTU depends on Kefir and not the other way around, so if we released a version bump of KTU, would we necessarily need to do the same with Kefir? I mean, there is no reason a user using Kefir 3.x needs to use KTU 2.x, they could continue to use KTU 1.x versions. |
Kefir uses KTU to test itself, so if KTU no longer supported those old node versions, we wouldn't be able to test Kefir on them either, which would effectively drop support for those versions from Kefir. |
We keep Kefir on KTU 1.x until we are ready for a major bump there? If we were to drop automated tests for node <8 on Kefir, I'm not sure if we need to do a major version bump. I mean, we wouldn't be breaking the contract it's just that we wouldn't be running automated tests on those older node versions. |
Generally, in other OS projects, dropping testing for a Node version means that version is no longer supported, which would be a breaking change. |
That's fair. Ooops, so I looked into kefir build status and it's already not running tests on node 6 and 8 because of an earlier change I did. 😓 What do you think I should do? |
I think we have two options:
Unfortunately, I don't have a ton of time right now to work on the overhaul but I can pitch in a bit, so you'd be taking on a good amount of the work for #2 if we want to go that route. Also cc @Macil @rpominov in case either of you have thoughts around this or if either of you are interested in & available to work on this. |
As long as I have you mentoring me, I think we can do the changes you think we need for the major bump. I don't know what I'm signing up for yet, but as I said to you in another issue, since I'm using Kefir daily now, I'd like to help it in any way I can. |
At a high level, here's what I'm thinking:
None of the packages have major breaking changes, but just a couple of odds & ends that I think would be improvements. We can document this on GitHub projects if this is something you're interested in working on. |
e92cc62
to
d238917
Compare
I've rebased this PR now that #314 has been merged, I think this one is ready to be merged as well. |
src/index.js
Outdated
import lolex from 'lolex' | ||
import * as fakeTimers from '@sinonjs/fake-timers' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of import * as
, let's just import install
. Maybe this is an over-optimization, but if we only use install
and there are other exports we don't use, this will be more tree-shakable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, I've updated it.
package.json
Outdated
"@types/node": "^14.0.1", | ||
"lolex": "^2.0.0" | ||
"@types/sinonjs__fake-timers": "^6.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the latest version of fake-timers
come w/ types? I think it might.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check the release notes, I don't use TS myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be upgrading fake timers to latest version, there have been quite a few releases since I first opened this PR.
In a recent release (8.0.0) types have been removed from the library.
5acdcc8
to
ce80307
Compare
I believe the test failure here is the result of a flaky test but do we have any idea why that test sometimes returns |
I honestly haven't looked deep yet, but this is what I noticed the last time I looked into it. I think we will need to mock |
Hmmm, I thought |
Okay, so I investigated this further, here is what I found: #335 |
@mAAdhaTTah now that #335 has been merged, tests are green with this change. |
Depends on #314
Closes #38