Files
openfoodnetwork/app/webpacker/js/window_location_wrapper.js
Gaetan Craig-Riou 4e62e20fa8 Fix test to work with new jsdom restriction
since jsdom 21, it's no longer possible to mock window.location
See : https://github.com/jsdom/jsdom/issues/3492
2025-11-11 14:58:48 +11:00

10 lines
231 B
JavaScript

// Wrapper around location window.location
//
// It's mainly needed because we can't mock window.location in jsdom
//
const locationPathName = (pathName) => {
window.location.pathname = pathName;
};
export { locationPathName };