Files
notifications-admin/tests/javascripts/support/polyfills.js

18 lines
421 B
JavaScript
Raw Normal View History

// Polyfills for any parts of the DOM API available in browsers but not JSDOM
let _location = {
reload: jest.fn(),
hostname: "beta.notify.gov",
assign: jest.fn(),
href: "https://beta.notify.gov",
}
2022-10-27 18:16:24 +00:00
// JSDOM provides a read-only window.location, which does not allow for
// mocking or setting.
Object.defineProperty(window, 'location', {
get: () => _location,
set: (value) => {
_location = value
},
})