Is/How is vitest polyfilling fetch for jsdom? #6428
Unanswered
dwjohnston
asked this question in
Q&A
Replies: 1 comment
-
Short answer is yes. See the logic here: vitest/packages/vitest/src/integrations/env/jsdom.ts Lines 78 to 99 in 372a2c2 Can I suggest that the documentation should be updated to reflect this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
JSDOM doesn't implement fetch. (See: jsdom/jsdom#3379)
Yet, I have a simple React application + vitest with a config of:
And fetch appears to exist. If we console log it, we see:
I'm curious - how is this functionality occuring? Is vitest providing a modified jsdom?
For context, jest doesn't do any automatic polyfilling of fetch in JSDOM, so MSW have provided a jest-fixed-jsdom environment that does.
Beta Was this translation helpful? Give feedback.
All reactions