Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
/**
|
|
*
|
|
* audit/utils
|
|
*
|
|
*/
|
|
import type { ExecutionResult } from 'graphql';
|
|
import { Audit, AuditName } from './common';
|
|
export * from '../utils';
|
|
/**
|
|
* Wrap and prepare an audit for testing.
|
|
*
|
|
* @private
|
|
*/
|
|
export declare function audit(id: string, name: AuditName, fn: () => Promise<void>): Audit;
|
|
/**
|
|
* Error thrown when an assertion test fails.
|
|
*
|
|
* @private
|
|
*/
|
|
export declare class AuditError {
|
|
/**
|
|
* Response from the server.
|
|
*/
|
|
response: Response;
|
|
/**
|
|
* Reason for the failing audit.
|
|
*/
|
|
reason: string;
|
|
constructor(response: Response, reason: string);
|
|
}
|
|
/**
|
|
* Will throw an AuditError if the assertion on Response fails.
|
|
*
|
|
* All fatal problems will throw an instance of an Error.
|
|
*
|
|
* The name "ressert" is a wordplay combining "response" and "assert".
|
|
*
|
|
* @private
|
|
*/
|
|
export declare function ressert(res: Response): {
|
|
status: {
|
|
toBe(code: number): void;
|
|
toBeBetween: (min: number, max: number) => void;
|
|
};
|
|
header(key: 'content-type'): {
|
|
toContain(part: string): void;
|
|
notToContain(part: string): void;
|
|
};
|
|
bodyAsExecutionResult: {
|
|
data: {
|
|
toBe(val: ExecutionResult['data']): Promise<void>;
|
|
};
|
|
toHaveProperty(key: keyof ExecutionResult): Promise<void>;
|
|
notToHaveProperty(key: keyof ExecutionResult): Promise<void>;
|
|
};
|
|
};
|