-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Describe the bug
Without experimentalVmThreads, our JSDOM tests can use Node's fetch implementation in our tests.
When experimentalVmThreads is enabled, the global fetch is missing.
Reproduction
vite.config.js:
import { defineConfig } from 'vite';
export default defineConfig({
test: {
experimentalVmThreads: true,
environment: 'jsdom'
}
});test file:
import { test, expect } from 'vitest';
test('global fetch', () => {
expect(globalThis.fetch).toBeDefined();
});System Info
System:
OS: Windows 10 10.0.22621
CPU: (64) x64 AMD Ryzen Threadripper 3970X 32-Core Processor
Memory: 23.16 GB / 31.88 GB
Binaries:
Node: 20.8.0 - C:\Program Files\nodejs\node.EXE
npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (117.0.2045.43)
Internet Explorer: 11.0.22621.1
npmPackages:
@vitejs/plugin-react: ^4.1.0 => 4.1.0
@vitest/coverage-v8: ^0.34.5 => 0.34.5
vite: ^4.4.9 => 4.4.9
vitest: ^0.34.5 => 0.34.5Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable