Skip to content

Commit 2e99726

Browse files
committed
Create mock implementation of navigator.registerProtocolHandler for jest
Maybe this will fix the tests for matrix-org/matrix-react-sdk#7700 Signed-off-by: Aaron Raimist <[email protected]>
1 parent 762fc53 commit 2e99726

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/jest-mocks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ Object.defineProperty(window, 'matchMedia', {
1313
})),
1414
});
1515

16+
Object.defineProperty(navigator, 'registerProtocolHandler', {
17+
value: jest.fn().mockImplementation(),
18+
});
19+
1620
// maplibre requires a createObjectURL mock
1721
global.URL.createObjectURL = jest.fn();

0 commit comments

Comments
 (0)