Add mock test for a 413 response from v1/challenge
This commit is contained in:
parent
2a55bfbef9
commit
9efb046a06
10 changed files with 194 additions and 59 deletions
7
ts/CI.ts
7
ts/CI.ts
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue