summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startAuthentication.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-04-13 08:27:39 -0700
committerGitHub <noreply@github.com>2022-04-13 08:27:39 -0700
commit8034e6e3ce62085814192094fe1288f90ec393af (patch)
tree736bd6de77e5e0153a71008aaf825ed853bb328e /packages/browser/src/methods/startAuthentication.test.ts
parentf46a315898dd31af268f7b36b39f1a28720c0072 (diff)
parente4714e4b31e2eb88733d63f92c1bf61511d25e83 (diff)
Merge pull request #191 from felixmosh/fix-190
Change error name to reflect the type
Diffstat (limited to 'packages/browser/src/methods/startAuthentication.test.ts')
-rw-r--r--packages/browser/src/methods/startAuthentication.test.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/browser/src/methods/startAuthentication.test.ts b/packages/browser/src/methods/startAuthentication.test.ts
index 848e9db..725cd4e 100644
--- a/packages/browser/src/methods/startAuthentication.test.ts
+++ b/packages/browser/src/methods/startAuthentication.test.ts
@@ -219,7 +219,7 @@ describe('WebAuthnError', () => {
const rejected = await expect(startAuthentication(goodOpts1)).rejects;
rejected.toThrow(WebAuthnError);
rejected.toThrow(/abort signal/i);
- rejected.toThrow(/AbortError/);
+ rejected.toHaveProperty('name', 'AbortError');
});
});
@@ -232,7 +232,7 @@ describe('WebAuthnError', () => {
const rejected = await expect(startAuthentication(goodOpts1)).rejects;
rejected.toThrow(WebAuthnError);
rejected.toThrow(/allowed credentials/i);
- rejected.toThrow(/NotAllowedError/);
+ rejected.toHaveProperty('name', 'NotAllowedError');
});
test('should identify cancellation or timeout', async () => {
@@ -247,7 +247,7 @@ describe('WebAuthnError', () => {
rejected.toThrow(WebAuthnError);
rejected.toThrow(/cancel/i);
rejected.toThrow(/timed out/i);
- rejected.toThrow(/NotAllowedError/);
+ rejected.toHaveProperty('name', 'NotAllowedError');
});
});
@@ -273,7 +273,7 @@ describe('WebAuthnError', () => {
rejected.toThrowError(WebAuthnError);
rejected.toThrow(/1\.2\.3\.4/);
rejected.toThrow(/invalid domain/i);
- rejected.toThrow(/SecurityError/);
+ rejected.toHaveProperty('name', 'SecurityError');
});
test('should identify invalid RP ID', async () => {
@@ -285,7 +285,7 @@ describe('WebAuthnError', () => {
rejected.toThrowError(WebAuthnError);
rejected.toThrow(goodOpts1.rpId);
rejected.toThrow(/invalid for this domain/i);
- rejected.toThrow(/SecurityError/);
+ rejected.toHaveProperty('name', 'SecurityError');
});
});
@@ -299,8 +299,8 @@ describe('WebAuthnError', () => {
rejected.toThrow(WebAuthnError);
rejected.toThrow(/authenticator/i);
rejected.toThrow(/unable to process the specified options/i);
- rejected.toThrow(/could not create a new assertion signature /i);
- rejected.toThrow(/UnknownError/);
+ rejected.toThrow(/could not create a new assertion signature/i);
+ rejected.toHaveProperty('name', 'UnknownError');
});
});
});