mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 11:23:48 -05:00
https://jestjs.io/docs/en/configuration#testurl-string Affects all DOM APIs that return information about the URL, for example window.location. Why: We now have tests for setting/deleting cookies. Tough-cookie, the library JSDOM uses for cookie handling cookies doesn't allow setting cookies with `domain=localhost`. This is correct by RFC6265, the standard it follows, as domains must have 2 or more `.`s in them. The only way to set a cookie on `localhost` is to leave out the `domain` attribute. The code we are testing sets and deletes cookies set on specific domains so using `localhost` is out. We also cannot just set/delete cookies on the domains used as cookies are required to match the domain of the current page. The solution we are left with is to set the current page to one from production and make sure each cookie is set relative to that domain. Note: this introduces `testURL` in isolation to be sure it doesn't break any existing tests.
5 lines
113 B
JavaScript
5 lines
113 B
JavaScript
module.exports = {
|
|
setupFiles: ['./support/setup.js'],
|
|
testURL: 'https://www.notifications.service.gov.uk'
|
|
}
|