You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all thanks for this really helpful and easy to use tool!!
I've searched trough the issues and discussions of this repo, but couldn't find any information on how to use @mswjs/data within an SSR context using remix and cypress.
I'm using this remix template, which already integrates MSW and it's working fine with RTL and vitest for unit tests. I tried setting the window object with the db instance but without any luck (that was the recommended approach in these other discussions/issues using cypress). I'm still getting two instances of the db, so i'm not able to reset the db after a cypress test.
So my question is: is it possible to share the db instance while using remix with cypress and MSW?
And if yes, where should i put the logic to share the db instance while using the above template?
Many thanks in advance for any tips or ideas!!
Edit
To give a bit more context: as i'm using remix, i mock the requests and handlers via the setupServer function instead of setupWorker as suggested in this issue. So i guess in this scenario i can't do the msw setup in the cypress context, as it is a browser environment?
The e2e dev environment is started via the start-server-and-test package:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First of all thanks for this really helpful and easy to use tool!!
I've searched trough the issues and discussions of this repo, but couldn't find any information on how to use
@mswjs/datawithin an SSR context usingremixandcypress.I'm using this remix template, which already integrates MSW and it's working fine with RTL and vitest for unit tests. I tried setting the
windowobject with thedbinstance but without any luck (that was the recommended approach in these other discussions/issues usingcypress). I'm still getting two instances of the db, so i'm not able to reset thedbafter acypresstest.So my question is: is it possible to share the
dbinstance while usingremixwithcypressand MSW?And if yes, where should i put the logic to share the
dbinstance while using the above template?Many thanks in advance for any tips or ideas!!
Edit
To give a bit more context: as i'm using
remix, i mock the requests and handlers via thesetupServerfunction instead ofsetupWorkeras suggested in this issue. So i guess in this scenario i can't do themswsetup in thecypresscontext, as it is a browser environment?The e2e dev environment is started via the
start-server-and-testpackage:Beta Was this translation helpful? Give feedback.
All reactions