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
MSW expects parentheses to be escaped in URLs but pretender does not. This prevents mirage-msw being a drop in replacement. Currently in my mirage setup I'm using a helper function to escape URL strings that contain parentheses if the test suite is running using mirage-msw. Migrating large number on mirage endpoint, small PR by small PR so need to support both MSW and pretender while migrating.
export default function mswEscapeUrl(stringUrl) {
if (ENV.useMsw) {
return stringUrl.replaceAll('(', '\\(').replaceAll(')', '\\)');
}
return stringUrl;
}
Here's the MSW test and mock showing this behaviour