mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 19:04:33 -04:00
Restore all mocked values after tests
In response to [1]. This prevents mocked values leaking between tests [2]. I did try to set 'mockRestore: true' in jest.config, but that means the restore happens before _every_ test, which isn't what we want. [1]: https://github.com/alphagov/notifications-admin/pull/3878#discussion_r631060116 [2]: https://jestjs.io/docs/jest-object#jestrestoreallmocks
This commit is contained in:
@@ -2,3 +2,5 @@ window.jQuery = null;
|
||||
$ = null;
|
||||
|
||||
delete window.GOVUK;
|
||||
|
||||
jest.restoreAllMocks();
|
||||
|
||||
Reference in New Issue
Block a user