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
-
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 usingremix
andcypress
.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 thedb
instance 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 thedb
after acypress
test.So my question is: is it possible to share the
db
instance while usingremix
withcypress
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 thesetupServer
function instead ofsetupWorker
as suggested in this issue. So i guess in this scenario i can't do themsw
setup in thecypress
context, as it is a browser environment?The e2e dev environment is started via the
start-server-and-test
package:Beta Was this translation helpful? Give feedback.
All reactions