Comments (3)
We are using @sinon/fake-timers
for timers mocking, so it would have to be implemented by them because we don't override global timers access. Or we would have to reimplement mocking ourselves which is also an option.
In any case, we can't do anything until the AsyncContext
API is implemented at least in one of the browsers and Node.js.
from vitest.
because we don't override global timers access
Sorry, but vitest definitely overrides global functions. Using
@sinon/fake-timers
'swithGlobal
, but withglobalThis
nonetheless.vitest/packages/vitest/src/integrations/vi.ts
Lines 365 to 368 in a4ec583
What I mean is that we don't override it (Vitest in its source code doesn't reassign globalThis.setTimeout
to control how it works, so we can't inject the context there), not that we don't override it.
from vitest.
because we don't override global timers access
Sorry, but vitest definitely overrides global functions. Using @sinon/fake-timers
's withGlobal
, but with globalThis
nonetheless.
vitest/packages/vitest/src/integrations/vi.ts
Lines 365 to 368 in a4ec583
from vitest.
Related Issues (20)
- testNamePattern doesn't parse RegEx'es in the CLI, or documentation is unclear HOT 2
- get error "Could not parse CSS stylesheet" when CSS file contains nested rules HOT 2
- Issue with `vitest --run --changed` when used with lint-staged on Windows HOT 2
- Default reporter emits `prepare` longer than `Duration` when prepare takes longer than 1s HOT 3
- test.each does not print -0 and -NaN correctly
- `vi.fn()` performs an extra _await_ leading to mismatching behaviour when compared with normal function HOT 6
- restoreAllMocks doesn't restore mocks HOT 4
- There's no console.log output from 'beforeAll' and 'afterAll' when running tests via Webstorm / Aqua IDE HOT 1
- Add support for Node.js 20 `--env-file` flag HOT 6
- vitest fails to load typescript worker code in node (but does so correctly in browser mode) HOT 6
- Better output in UI mode for screen.debug() HOT 2
- ReferenceError on globals using Vitest HOT 2
- Additional type definitions are ignored
- Second (Custom Message) Argument Breaks expect().toBeVisible() HOT 2
- Missing link in Documentation mocking requests HOT 1
- vi.stubEnv documentation and typing differ from each other
- `MY_ENV=abc vitest` exposes `import.meta.env.MY_ENV === "abc"` HOT 2
- Support it() as well for bench HOT 2
- Vitest 1.6.0 upgrade breaks sandboxing the filesystem from tests HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitest.