mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor: one eslint task per workspace (#63835)
This commit is contained in:
committed by
GitHub
parent
c9e83c5c6a
commit
1e0805fd72
+11
-10
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable jsdoc/require-jsdoc */
|
||||
import { beforeAll, afterAll, expect, vi } from 'vitest';
|
||||
import request from 'supertest';
|
||||
|
||||
@@ -46,13 +47,13 @@ export const getCookies = (setCookies: string[]): string => {
|
||||
* A wrapper around supertest that handles common setup for requests. Namely
|
||||
* setting the Origin header, cookies and CSRF token.
|
||||
*
|
||||
* @param resource - The URL of the resource to be requested
|
||||
* @param config - The configuration for the request
|
||||
* @param config.method - The HTTP method to be used
|
||||
* @param config.setCookies - The cookies to be set in the request
|
||||
* @param options - Additional options for the request
|
||||
* @param options.sendCSRFToken - Whether to send the CSRF token in the request (default: true)
|
||||
* @returns The request object
|
||||
* @param resource - The URL of the resource to be requested.
|
||||
* @param config - The configuration for the request.
|
||||
* @param config.method - The HTTP method to be used.
|
||||
* @param config.setCookies - The cookies to be set in the request.
|
||||
* @param options - Additional options for the request.
|
||||
* @param options.sendCSRFToken - Whether to send the CSRF token in the request (default: true).
|
||||
* @returns The request object.
|
||||
*/
|
||||
export function superRequest(
|
||||
resource: string,
|
||||
@@ -83,9 +84,9 @@ export function superRequest(
|
||||
* request function with the desired method and setCookies baked in.
|
||||
*
|
||||
* @param config
|
||||
* @param config.method - HTTP method
|
||||
* @param config.setCookies - Cookies to be set in the request
|
||||
* @returns A superRequest function with the desired method and setCookies
|
||||
* @param config.method - HTTP method.
|
||||
* @param config.setCookies - Cookies to be set in the request.
|
||||
* @returns A superRequest function with the desired method and setCookies.
|
||||
*/
|
||||
export function createSuperRequest(config: {
|
||||
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||
|
||||
Reference in New Issue
Block a user