Skip to content

Commit

Permalink
apply linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
itrion authored and Javier Toledo committed Oct 7, 2020
1 parent bcc8aa1 commit 2f4ef78
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ describe('Given the Authentication API', () => {
'Access-Control-Request-Headers': 'X-any-header',
Origin: internet.url(),
},
}),
})
)
}

function performPreflightRequest(url: string) {
return (options: RequestInit) => fetch(url, options)
}

function assertResponseContainsPreflightHeaders(response: Response) {
function assertResponseContainsPreflightHeaders(response: Response): void {
expect(response.status).to.be.eq(204)
expect(response.headers.get('Access-Control-Allow-Origin')).to.be.eq('*')
expect(response.headers.get('Access-Control-Allow-Headers')).to.be.eq('*')
Expand All @@ -176,7 +176,13 @@ describe('Given the Authentication API', () => {
.and.to.include('POST')
}

async function verifyResponseAndAllowedOriginHeader(response: Response, expectedHttpStatus: number, expectedAllowedOrigin: string, jsonBody: any) {
async function verifyResponseAndAllowedOriginHeader(
response: Response,
expectedHttpStatus: number,
expectedAllowedOrigin: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
jsonBody: any
): Promise<void> {
expect(response.status).to.be.eq(expectedHttpStatus, `Response body was: ${JSON.stringify(jsonBody)}`)
expect(response.headers.get('Access-Control-Allow-Origin')).to.be.eq(expectedAllowedOrigin)
}
Expand Down

0 comments on commit 2f4ef78

Please sign in to comment.