Skip to content

Commit

Permalink
tests: Access the Location response header the normal way
Browse files Browse the repository at this point in the history
I don't know why this was reaching into the internals of the Headers
object.  The use of a Symbol key which isn't directly addressable should
have been a hint this wasn't the right way, but maybe there were
mitigating factors…?  (old Node version lacking proper support?)
  • Loading branch information
tsibley committed Nov 23, 2021
1 parent 9291725 commit c7d1f53
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/smoke-test/auspice_client_requests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,5 @@ function testRedirect(res, expectedRedirectAddress) {
if (res.status!==302) {
throw Error(`Test asked to check redirect address, but statusCode wasn't 302`);
}
expect(getRedirectLocation(res)).toEqual(expectedRedirectAddress);
}

function getRedirectLocation(res) {
return res.headers[Object.getOwnPropertySymbols(res.headers)[0]].location[0];
expect(res.headers.get("Location")).toEqual(expectedRedirectAddress);
}

0 comments on commit c7d1f53

Please sign in to comment.