Logo
Explore Help
Sign In
darkhelm/notifications-admin
1
0
Fork 0
You've already forked notifications-admin
mirror of https://github.com/GSA/notifications-admin.git synced 2026-02-11 05:43:44 -05:00
Code Issues Packages Projects Releases Wiki Activity
Files
27f7e873f1defb2d439deecb00a978c63def4106
notifications-admin/tests/javascripts/jest.config.js

5 lines
113 B
JavaScript
Raw Normal View History

Move setup/teardown out of tests
2019-05-21 10:56:38 +01:00
module.exports = {
Change the URL JSDOM uses for the current page 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.
2020-01-22 10:13:37 +00:00
setupFiles: ['./support/setup.js'],
testURL: 'https://www.notifications.service.gov.uk'
Move setup/teardown out of tests
2019-05-21 10:56:38 +01:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.0 Page: 1889ms Template: 15ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API