There's any way to use MSW and createRemixStub helper? #7997
Unanswered
pauloricardos
asked this question in
Q&A
Replies: 1 comment
-
up |
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
Uh oh!
There was an error while loading. Please reload this page.
-
First of all, i'm new using Remix framework, so maybe there's a better approach.
I want to test my root component, which uses the
useLoaderData
hook, then calls my internalhttpClient
and then an external endpoint usingMSW
. If i just callcreateRemixStub
and return a mock of data on the loader parameter, works fine, but i want to test it using MSW. I already tried to mock useLoaderData itself using vitest, but it seems the same thing usingcreateRemixStub
.There's any way to assert the behavior of rendering a list of data using
MSW
andcreateRemixStub
? Or a better way to server render my data?Here's my component and related files:
_index.tsx
retrievePokemons.server.ts
Beta Was this translation helpful? Give feedback.
All reactions