Add mock test for a 413 response from v1/challenge
This commit is contained in:
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,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user