summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startRegistration.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-09-28 21:14:32 -0700
committerGitHub <noreply@github.com>2022-09-28 21:14:32 -0700
commit8b75f0836e39df29b8593f96fb806608c2a81196 (patch)
treeba1d6e1346ba40cddc35f5a9c2f3ca68358eecc2 /packages/browser/src/methods/startRegistration.test.ts
parente64b50cc84d49478d49e0a394511963d0110277b (diff)
parent4ea0bd370609294e3cf70f467d234093fc6e87fb (diff)
Merge pull request #275 from MasterKale/fix/webauthn-abort-controller-race-condition
fix/webauthn-abort-controller-race-condition
Diffstat (limited to 'packages/browser/src/methods/startRegistration.test.ts')
-rw-r--r--packages/browser/src/methods/startRegistration.test.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/browser/src/methods/startRegistration.test.ts b/packages/browser/src/methods/startRegistration.test.ts
index 9a7196b..2dc11be 100644
--- a/packages/browser/src/methods/startRegistration.test.ts
+++ b/packages/browser/src/methods/startRegistration.test.ts
@@ -59,6 +59,10 @@ beforeEach(() => {
});
mockSupportsWebauthn.mockReturnValue(true);
+
+ // Reset the abort service so we get an accurate call count
+ // @ts-ignore
+ webauthnAbortService.controller = undefined;
});
afterEach(() => {
@@ -215,8 +219,6 @@ test('should return "cable" transport from response', async () => {
test('should cancel an existing call when executed again', async () => {
const abortSpy = jest.spyOn(AbortController.prototype, 'abort');
- // Reset the abort service so we get an accurate call count
- webauthnAbortService.reset();
// Fire off a request and immediately attempt a second one
startRegistration(goodOpts1);