summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-03-06 22:54:54 -0800
committerMatthew Miller <matthew@millerti.me>2022-03-06 22:54:54 -0800
commitd710a018e3a64be907ff97f068a8d3cb3b3fee12 (patch)
tree450a2d21888fab0e09e965ef05993e7dea28d33b
parentb896d85e925825fcf0abe5768c0e0f35dc952708 (diff)
Add mock for window.location.hostname
-rw-r--r--packages/browser/src/setupTests.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/browser/src/setupTests.ts b/packages/browser/src/setupTests.ts
index 042dc9c..5b6efcf 100644
--- a/packages/browser/src/setupTests.ts
+++ b/packages/browser/src/setupTests.ts
@@ -15,3 +15,12 @@ Object.defineProperty(window.navigator, 'credentials', {
},
});
+/**
+ * Allow for setting values to `window.location.hostname`
+ */
+Object.defineProperty(window, 'location', {
+ writable: true,
+ value: {
+ hostname: '',
+ },
+});