Skip to content

How to configure a proxy for Vitest #5637

Answered by hi-ogawa
mistercoffee66 asked this question in Q&A
Discussion options

You must be logged in to vote

fetch("/api") is meant to run on browser where url origin is automatically inferred, so it's not possible on NodeJS and server.proxy is not meant to work on Vitest.
You probably need to go with mocking fetch during tests.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mistercoffee66
Comment options

@sheremet-va
Comment options

@mistercoffee66
Comment options

@sheremet-va
Comment options

@mistercoffee66
Comment options

Answer selected by mistercoffee66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants