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
Bring config.target
into the light
#2156
Conversation
Basically fails due to sinonjs/fake-timers#276. One option I highlight there is to basically remove the |
6f52a4e
to
56f4f74
Compare
Updated docs: show link directly to lolex.install() docs to simplify digging for the actual possible values. Update test exception string
56f4f74
to
4ceac2b
Compare
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.
This looks good 👍
Needs a bit of love to get the tests passing.
Once this is in, I think we should put out the next semver:major
with a good changelog update.
@mroderick This kind of stalled because I don't know how to act around @SimenB's comment in Lolex, as this turned out to have a little catch: sinonjs/fake-timers#276 (comment): Is there a reason one might want to use the timers from a second environment and "pass them" into a third? That's basically the use case the current behavior supports that simplifying this in Lolex would remove. |
FWIW, I don't think it's necessarily a valid use case. Maybe you want a working |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think that for now this can land as is, and if anything changes in lolex we can revisit. But the current implementation matches what's documented in this PR |
Just use withGlobal(target) instead. See sinonjs#276 for background and/or sinonjs/sinon#2156
Sorry for keeping this hanging. Will redo once sinonjs/fake-timers#318 is merged. |
How would we like the API to look here? Keep the Might be worth considering that nise could also use such a thing. |
See sinonjs#276 for background and/or sinonjs/sinon#2156
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@fatso83 I think there's nothing left blocking this ... is there? |
As sinonjs/fake-timers#318 removed |
Purpose (TL;DR) - mandatory
Remove unneeded branch logic and improve docs.
Background (Problem in detail) - optional
When looking into a user question (#2155) it became obvious that the
it's not obvious at all that the docs for Lolex install config can be
used when trying to configure
useFakeTimers
.For one, we added a prop,
config.global
, to Sinon'suseFakeTimers
config in #1935 thatwas quite superfluous: it supported a use case that was already there using
config.target
!In this PR, I remove some extra branching logic and also update the docs
to highlight the lolex docs and the
target
prop.How to verify - mandatory
npm test
npm run build-docs