diff options
author | Pascal Sthamer <sthamer.pascal@gmail.com> | 2020-05-25 19:22:46 +0200 |
---|---|---|
committer | Pascal Sthamer <sthamer.pascal@gmail.com> | 2020-05-25 19:22:46 +0200 |
commit | ab04d0e332174d1df80af0446c955dc1abb56c6c (patch) | |
tree | fdb48854b67c90d359f1b02ac9d5ee6c9c76957f /packages/browser/src/setupTests.ts | |
parent | 8b57ce0ad5f5318a236c042becebfc07ed6fa99a (diff) |
Add test for window being undefined
Diffstat (limited to 'packages/browser/src/setupTests.ts')
-rw-r--r-- | packages/browser/src/setupTests.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/browser/src/setupTests.ts b/packages/browser/src/setupTests.ts index 019ba42..75833a8 100644 --- a/packages/browser/src/setupTests.ts +++ b/packages/browser/src/setupTests.ts @@ -3,6 +3,9 @@ // jest.spyOn(console, 'debug').mockImplementation(); // jest.spyOn(console, 'error').mockImplementation(); +// @ts-expect-error +if (global.window) { + /** * JSDom doesn't seem to support `credentials`, so let's define them here so we can mock their * implementations in specific tests. @@ -14,3 +17,4 @@ window.navigator.credentials = { // assertion get: jest.fn(), }; +}
\ No newline at end of file |