refactor(api): DRY out route tests (#52193)

This commit is contained in:
Oliver Eyton-Williams
2023-11-16 09:08:32 +01:00
committed by GitHub
parent d177afa037
commit 30667f3b0d
5 changed files with 270 additions and 591 deletions
+7
View File
@@ -58,6 +58,13 @@ export function superRequest(
return req;
}
export function createSuperRequest(config: {
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
setCookies?: string[];
}): (resource: string, options?: Options) => request.Test {
return (resource, options) => superRequest(resource, config, options);
}
export function setupServer(): void {
let fastify: FastifyTestInstance;
beforeAll(async () => {