diff options
author | Matthew Miller <matthew@millerti.me> | 2022-03-06 22:54:36 -0800 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-03-06 22:54:36 -0800 |
commit | b896d85e925825fcf0abe5768c0e0f35dc952708 (patch) | |
tree | c190e8812ab9ae818fa2b3c0ee708fb13ef78310 /packages/browser/src | |
parent | 8c16f0a5a1240d51e9526fe83eca1f1e8948f10c (diff) |
Update how navigator.credentials is mocked
Diffstat (limited to 'packages/browser/src')
-rw-r--r-- | packages/browser/src/setupTests.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/browser/src/setupTests.ts b/packages/browser/src/setupTests.ts index 019ba42..042dc9c 100644 --- a/packages/browser/src/setupTests.ts +++ b/packages/browser/src/setupTests.ts @@ -7,10 +7,11 @@ * JSDom doesn't seem to support `credentials`, so let's define them here so we can mock their * implementations in specific tests. */ -// @ts-ignore 2540 -window.navigator.credentials = { - // attestation - create: jest.fn(), - // assertion - get: jest.fn(), -}; +Object.defineProperty(window.navigator, 'credentials', { + writable: true, + value: { + create: jest.fn(), + get: jest.fn(), + }, +}); + |