API for Mocking Globals with Isolation #554
Replies: 4 comments 1 reply
-
|
This sounds very interesting indeed, and I did go to checkout the example vitest sandbox. I only saw a "Upgrade Required" in the output, which might explain the failing test 😄 I did catch the gist of the concept though, and I absolutely find the concept of keeping async contexts worth considering. Are there anyone outside of Node doing something similar to AsyncContext? It would be fine to have a node-only feature to start out. |
Beta Was this translation helpful? Give feedback.
-
|
In my case specifically, I'm writing tests for a project built on Workers, but in that case, you still have access to AsyncContext because of the platform's Node Compatibility Mode. |
Beta Was this translation helpful? Give feedback.
-
|
Sure, if you can flesh out a PR or a POC we can have something to discuss. |
Beta Was this translation helpful? Give feedback.
-
|
Just to clarify: "the team" is essentially me most of the time, these days. And since I am usually not doing much javascript coding these days, any work on fake timers I have been doing for the last 5 years is purely voluntary work in my free time, so just providing a bunch of work on some random feature is usually not something that is likely to just happen by chance 😉 My main concerns are
because that's what I enjoy 😊 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi y'all!
I wanted to ask, what is the stance of the team on providing a way to set mocks on global timing-related APIs that can be locked to a given scope? For example:
This is related to vitest#5750
Beta Was this translation helpful? Give feedback.
All reactions