diff --git a/src/dev/demo/index.ts b/src/dev/demo/index.ts index 533f634c..ed375917 100644 --- a/src/dev/demo/index.ts +++ b/src/dev/demo/index.ts @@ -17,12 +17,10 @@ import { } from "../../webauthn-json/browser-ponyfill"; function registeredCredentials(): PublicKeyCredentialDescriptorJSON[] { - return getRegistrations().map( - (reg) => ({ - id: reg.rawId, - type: reg.type, - }), - ); + return getRegistrations().map((reg) => ({ + id: reg.rawId, + type: reg.type, + })); } async function register(): Promise { @@ -70,22 +68,21 @@ async function testSupported() { window.addEventListener("load", () => { try { - document.querySelector("#register")!.addEventListener( - "click", - withStatus("#register .status", register), - ); - document.querySelector("#authenticate")!.addEventListener( - "click", - withStatus("#authenticate .status", authenticate), - ); - document.querySelector("#clear")!.addEventListener( - "click", - withStatus("#clear .status", clear), - ); - document.querySelector("#supported")!.addEventListener( - "click", - testSupported, - ); + document + .querySelector("#register")! + .addEventListener("click", withStatus("#register .status", register)); + document + .querySelector("#authenticate")! + .addEventListener( + "click", + withStatus("#authenticate .status", authenticate), + ); + document + .querySelector("#clear")! + .addEventListener("click", withStatus("#clear .status", clear)); + document + .querySelector("#supported")! + .addEventListener("click", testSupported); } catch (e) { console.error(e); } diff --git a/src/webauthn-json/webauthn-schema.spec.ts b/src/webauthn-json/webauthn-schema.spec.ts index 6b008550..b9e86a2d 100644 --- a/src/webauthn-json/webauthn-schema.spec.ts +++ b/src/webauthn-json/webauthn-schema.spec.ts @@ -17,6 +17,10 @@ import { import { convert } from "./convert"; import "./arraybuffer.jest"; +const unimplemented: any = () => { + throw new Error("unimplemented"); +}; + describe("webauthn schema", () => { test("converts CredentialCreationOptionsJSON", () => { const cco: CredentialCreationOptionsJSON = { @@ -67,6 +71,9 @@ describe("webauthn schema", () => { clientDataJSON: new Uint8Array([9, 10, 11, 12]), attestationObject: new Uint8Array([13, 14, 15, 16]), getTransports: () => ["usb"], + getAuthenticatorData: unimplemented, + getPublicKey: unimplemented, + getPublicKeyAlgorithm: unimplemented, } as AuthenticatorAttestationResponse, getClientExtensionResults: () => ({ @@ -109,6 +116,10 @@ describe("webauthn schema", () => { response: { clientDataJSON: new Uint8Array([9, 10, 11, 12]), attestationObject: new Uint8Array([13, 14, 15, 16]), + getAuthenticatorData: unimplemented, + getPublicKey: unimplemented, + getPublicKeyAlgorithm: unimplemented, + getTransports: unimplemented, } as AuthenticatorAttestationResponse, getClientExtensionResults: () => ({