diff options
author | Matthew Miller <matthew@millerti.me> | 2022-03-06 22:54:54 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-03-06 22:54:54 -0800 |
commit | d710a018e3a64be907ff97f068a8d3cb3b3fee12 (patch) | |
tree | 450a2d21888fab0e09e965ef05993e7dea28d33b | |
parent | b896d85e925825fcf0abe5768c0e0f35dc952708 (diff) |
Add mock for window.location.hostname
-rw-r--r-- | packages/browser/src/setupTests.ts | 9 |
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: '', + }, +}); |