summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/setupTests.ts
diff options
context:
space:
mode:
authorPascal Sthamer <sthamer.pascal@gmail.com>2020-05-25 19:22:46 +0200
committerPascal Sthamer <sthamer.pascal@gmail.com>2020-05-25 19:22:46 +0200
commitab04d0e332174d1df80af0446c955dc1abb56c6c (patch)
treefdb48854b67c90d359f1b02ac9d5ee6c9c76957f /packages/browser/src/setupTests.ts
parent8b57ce0ad5f5318a236c042becebfc07ed6fa99a (diff)
Add test for window being undefined
Diffstat (limited to 'packages/browser/src/setupTests.ts')
-rw-r--r--packages/browser/src/setupTests.ts4
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