Gate wtfnode behind WTF_NODE env var
After thinking about it some more it's probably mostly only useful to see the output when the tests are hanging. Otherwise there's a lot of noise about Jest child processes and pipes.
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { logger, field } from "@coder/logger"
|
||||
import { Cookie } from "../../test/helpers"
|
||||
|
||||
export interface Options {
|
||||
base: string
|
||||
@ -121,24 +120,3 @@ export function logError(prefix: string, err: any): void {
|
||||
logger.error(`${prefix}: ${err}`)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a cookie exists in array of cookies
|
||||
*/
|
||||
export function checkForCookie(cookies: Array<Cookie>, key: string): boolean {
|
||||
// Check for a cookie where the name is equal to key
|
||||
return Boolean(cookies.find((cookie) => cookie.name === key))
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a login cookie if one doesn't already exist
|
||||
*/
|
||||
export function createCookieIfDoesntExist(cookies: Array<Cookie>, cookieToStore: Cookie): Array<Cookie> {
|
||||
const cookieName = cookieToStore.name
|
||||
const doesCookieExist = checkForCookie(cookies, cookieName)
|
||||
if (!doesCookieExist) {
|
||||
const updatedCookies = [...cookies, cookieToStore]
|
||||
return updatedCookies
|
||||
}
|
||||
return cookies
|
||||
}
|
||||
|
Reference in New Issue
Block a user