Skip to content

Commit

Permalink
Create mock implementation of navigator.registerProtocolHandler for jest
Browse files Browse the repository at this point in the history
Maybe this will fix the tests for matrix-org/matrix-react-sdk#7700

Signed-off-by: Aaron Raimist <[email protected]>
  • Loading branch information
aaronraimist committed Feb 9, 2022
1 parent 762fc53 commit 2e99726
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/jest-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ Object.defineProperty(window, 'matchMedia', {
})),
});

Object.defineProperty(navigator, 'registerProtocolHandler', {
value: jest.fn().mockImplementation(),
});

// maplibre requires a createObjectURL mock
global.URL.createObjectURL = jest.fn();

0 comments on commit 2e99726

Please sign in to comment.