diff options
author | Matthew Miller <matthew@millerti.me> | 2022-09-27 21:10:22 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2022-09-28 14:51:02 -0700 |
commit | 4ea0bd370609294e3cf70f467d234093fc6e87fb (patch) | |
tree | ba1d6e1346ba40cddc35f5a9c2f3ca68358eecc2 /packages/browser/src/helpers | |
parent | a86025d58417e729171862bdbed69795f7814452 (diff) |
Remove reset() from abort service
Diffstat (limited to 'packages/browser/src/helpers')
-rw-r--r-- | packages/browser/src/helpers/webAuthnAbortService.test.ts | 20 | ||||
-rw-r--r-- | packages/browser/src/helpers/webAuthnAbortService.ts | 4 |
2 files changed, 0 insertions, 24 deletions
diff --git a/packages/browser/src/helpers/webAuthnAbortService.test.ts b/packages/browser/src/helpers/webAuthnAbortService.test.ts index f4e6344..294a894 100644 --- a/packages/browser/src/helpers/webAuthnAbortService.test.ts +++ b/packages/browser/src/helpers/webAuthnAbortService.test.ts @@ -20,23 +20,3 @@ test('should call abort() on existing controller when creating a new signal', () webauthnAbortService.createNewAbortSignal(); expect(abortSpy).toHaveBeenCalledTimes(1); }); - -test('should reset controller', () => { - // Reset the service - webauthnAbortService.reset(); - - // Populate `.controller` - webauthnAbortService.createNewAbortSignal(); - - // Spy on the existing instance of AbortController - const abortSpy = jest.fn(); - // @ts-ignore - webauthnAbortService.controller?.abort = abortSpy; - - // Reset the service - webauthnAbortService.reset(); - - // Generate a new signal, which should NOT call `abort()` because the controller was cleared - webauthnAbortService.createNewAbortSignal(); - expect(abortSpy).toHaveBeenCalledTimes(0); -}); diff --git a/packages/browser/src/helpers/webAuthnAbortService.ts b/packages/browser/src/helpers/webAuthnAbortService.ts index 268f008..479df55 100644 --- a/packages/browser/src/helpers/webAuthnAbortService.ts +++ b/packages/browser/src/helpers/webAuthnAbortService.ts @@ -18,10 +18,6 @@ class WebAuthnAbortService { this.controller = new AbortController(); return this.controller.signal; } - - reset() { - this.controller = undefined; - } } export const webauthnAbortService = new WebAuthnAbortService(); |