Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Jul 31, 2024
1 parent f98f6c2 commit 78b9481
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runner/test/cases/server/plugins/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ suite("Server Auth", () => {
method: "GET",
url: "/",
});
const initialSession = prepResponse.headers["set-cookie"].find((cookie) =>
cookie.startsWith("session=")
);
const initialSessionCookie = prepResponse.headers["set-cookie"]
.find((cookie) => cookie.startsWith("session="))
.replace("HttpOnly; ");

// We can first check the created session works as expected:
const checkPrepResponse = await server.inject({
method: "GET",
url: "/",
headers: {
Cookie: initialSession.replace("Secure; HttpOnly; ", ""),
Cookie: initialSessionCookie,
},
});
expect(
Expand All @@ -98,7 +98,7 @@ suite("Server Auth", () => {
method: "GET",
url: "/logout",
headers: {
Cookie: initialSession.replace("Secure; HttpOnly; ", ""),
Cookie: initialSessionCookie,
},
});

Expand All @@ -108,7 +108,7 @@ suite("Server Auth", () => {
);

expect(newSession).to.not.be.undefined();
expect(newSession).to.not.equal(initialSession);
expect(newSession).to.not.equal(initialSessionCookie);
expect(
res.headers["set-cookie"].filter((cookie) =>
cookie.startsWith("auth=;")
Expand Down

0 comments on commit 78b9481

Please sign in to comment.