Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit cf64a49

Browse files
committed
Update tests.
1 parent aa509f5 commit cf64a49

2 files changed

Lines changed: 30 additions & 22 deletions

File tree

src/dev/demo/index.ts

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@ import {
1717
} from "../../webauthn-json/browser-ponyfill";
1818

1919
function registeredCredentials(): PublicKeyCredentialDescriptorJSON[] {
20-
return getRegistrations().map(
21-
(reg) => ({
22-
id: reg.rawId,
23-
type: reg.type,
24-
}),
25-
);
20+
return getRegistrations().map((reg) => ({
21+
id: reg.rawId,
22+
type: reg.type,
23+
}));
2624
}
2725

2826
async function register(): Promise<void> {
@@ -70,22 +68,21 @@ async function testSupported() {
7068

7169
window.addEventListener("load", () => {
7270
try {
73-
document.querySelector("#register")!.addEventListener(
74-
"click",
75-
withStatus("#register .status", register),
76-
);
77-
document.querySelector("#authenticate")!.addEventListener(
78-
"click",
79-
withStatus("#authenticate .status", authenticate),
80-
);
81-
document.querySelector("#clear")!.addEventListener(
82-
"click",
83-
withStatus("#clear .status", clear),
84-
);
85-
document.querySelector("#supported")!.addEventListener(
86-
"click",
87-
testSupported,
88-
);
71+
document
72+
.querySelector("#register")!
73+
.addEventListener("click", withStatus("#register .status", register));
74+
document
75+
.querySelector("#authenticate")!
76+
.addEventListener(
77+
"click",
78+
withStatus("#authenticate .status", authenticate),
79+
);
80+
document
81+
.querySelector("#clear")!
82+
.addEventListener("click", withStatus("#clear .status", clear));
83+
document
84+
.querySelector("#supported")!
85+
.addEventListener("click", testSupported);
8986
} catch (e) {
9087
console.error(e);
9188
}

src/webauthn-json/webauthn-schema.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import {
1717
import { convert } from "./convert";
1818
import "./arraybuffer.jest";
1919

20+
const unimplemented: any = () => {
21+
throw new Error("unimplemented");
22+
};
23+
2024
describe("webauthn schema", () => {
2125
test("converts CredentialCreationOptionsJSON", () => {
2226
const cco: CredentialCreationOptionsJSON = {
@@ -67,6 +71,9 @@ describe("webauthn schema", () => {
6771
clientDataJSON: new Uint8Array([9, 10, 11, 12]),
6872
attestationObject: new Uint8Array([13, 14, 15, 16]),
6973
getTransports: () => ["usb"],
74+
getAuthenticatorData: unimplemented,
75+
getPublicKey: unimplemented,
76+
getPublicKeyAlgorithm: unimplemented,
7077
} as AuthenticatorAttestationResponse,
7178
getClientExtensionResults: () =>
7279
({
@@ -109,6 +116,10 @@ describe("webauthn schema", () => {
109116
response: {
110117
clientDataJSON: new Uint8Array([9, 10, 11, 12]),
111118
attestationObject: new Uint8Array([13, 14, 15, 16]),
119+
getAuthenticatorData: unimplemented,
120+
getPublicKey: unimplemented,
121+
getPublicKeyAlgorithm: unimplemented,
122+
getTransports: unimplemented,
112123
} as AuthenticatorAttestationResponse,
113124
getClientExtensionResults: () =>
114125
({

0 commit comments

Comments
 (0)