Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maorleger/vitest-browser-usefaketimers-repro
https://github.com/maorleger/vitest-browser-usefaketimers-repro
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maorleger/vitest-browser-usefaketimers-repro
- Owner: maorleger
- Created: 2024-01-16T19:21:46.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-16T19:30:19.000Z (12 months ago)
- Last Synced: 2024-12-09T18:01:28.949Z (about 1 month ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minimal repro of an issue found in vi.useFakeTimers
When using vi.useFakeTimers to fake `setTimeout`, 1.2.x throws `process is not defined` errors. I _think_ this was introduced in [#4441](https://github.com/vitest-dev/vitest/pull/4441/files) which standardized to using a [isChildProcess](https://github.com/vitest-dev/vitest/pull/4441/files#diff-151cb4f9e52fa755205f26dfd60741bd1eb6b47cbcbfc818b9400e695a87912cR154) helper function instead of various checks against `globalThis.__vitest_worker__.isChildProcess`.
## To repro
```
npm install
npm run test
```Expected: the test passes
Actual: `ReferenceError: process is not defined`
Note that the first commit in this repo [abe06c7](https://github.com/maorleger/vitest-browser-useFakeTimers-repro/commit/abe06c7fb3ea4306669b6b713c34504693b69f33) passes when using 1.1.x