Add mock test for a 413 response from v1/challenge

This commit is contained in:
Scott Nonnenberg 2024-09-10 06:31:20 +10:00 committed by GitHub
parent 2a55bfbef9
commit 9efb046a06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 194 additions and 59 deletions

View file

@ -23,6 +23,7 @@ export type CIType = {
getMessagesBySentAt(
sentAt: number
): Promise<ReadonlyArray<MessageAttributesType>>;
getPendingEventCount: (event: string) => number;
handleEvent: (event: string, data: unknown) => unknown;
setProvisioningURL: (url: string) => unknown;
solveChallenge: (response: ChallengeResponseType) => unknown;
@ -101,6 +102,11 @@ export function getCI({
return promise;
}
function getPendingEventCount(event: string): number {
const completed = completedEvents.get(event) || [];
return completed.length;
}
function setProvisioningURL(url: string): void {
handleEvent('provisioning-url', url);
}
@ -197,5 +203,6 @@ export function getCI({
exportBackupToDisk,
exportPlaintextBackupToDisk,
unlink,
getPendingEventCount,
};
}