mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-28 03:12:04 -04:00
Fix confusing error messages when debugging
Previously a bug in the first test would lead to a 'not implemented' console error, which isn't the actual problem. This ensures alert() is just a simple no-op, so we can concentrate on actual errors.
This commit is contained in:
@@ -6,6 +6,9 @@ beforeAll(() => {
|
||||
// you might need to comment this out to debug some failures
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {})
|
||||
|
||||
// ensure window.alert() is implemented to simplify errors
|
||||
jest.spyOn(window, 'alert').mockImplementation(() => {})
|
||||
|
||||
// populate missing values to allow consistent jest.spyOn()
|
||||
window.fetch = () => {}
|
||||
window.navigator.credentials = { create: () => {} }
|
||||
|
||||
Reference in New Issue
Block a user