mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(api): DRY out route tests (#52193)
This commit is contained in:
committed by
GitHub
parent
d177afa037
commit
30667f3b0d
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user