Skip to content

Commit

Permalink
refactor: scope constant for reuse
Browse files Browse the repository at this point in the history
Context: #81 (comment)

Co-authored-by: Gregor Martynus <[email protected]>
  • Loading branch information
francisfuzz and gr2m committed Sep 13, 2024
1 parent d62dd94 commit 4828168
Showing 1 changed file with 8 additions and 34 deletions.
42 changes: 8 additions & 34 deletions test/verification.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ S0+XhEkTWUZEEznIVpS3rQseDTG6//gEWr4j9fY35+dGOxwOx3Z9mK3i7w==
export const SIGNATURE =
"MEYCIQC8aEmkYA/4EQrXEOi2OL9nfpbnrCxkMc6HrH7b6SogKgIhAIYBThcpzkCCswiV1+pOaPI+zFQF9ShG61puoKs9rJjq";

const publicKeys = [
{
key: CURRENT_PUBLIC_KEY,
key_identifier: KEY_ID,
is_current: true,
},
];

test("smoke", (t) => {
t.is(typeof verifyRequestByKeyId, "function");
});
Expand All @@ -34,14 +42,6 @@ test("verifyRequestByKeyId()", async (t) => {
return fetch(url, opts);
}

const publicKeys = [
{
key: CURRENT_PUBLIC_KEY,
key_identifier: KEY_ID,
is_current: true,
},
];

mockAgent.disableNetConnect();
const mockPool = mockAgent.get("https://api.github.com");
mockPool
Expand Down Expand Up @@ -142,19 +142,6 @@ test("fetchVerificationKeys() - without cache", async (t) => {
return fetch(url, opts);
}

const publicKeys = [
{
key: "<key 1>",
key_identifier: "<key-id 1>",
is_current: true,
},
{
key: "<key 2>",
key_identifier: "<key-id 2>",
is_current: true,
},
];

mockAgent.disableNetConnect();
const mockPool = mockAgent.get("https://api.github.com");
mockPool
Expand Down Expand Up @@ -193,19 +180,6 @@ test("fetchVerificationKeys() - with cache", async (t) => {
return fetch(url, opts);
}

const publicKeys = [
{
key: "<key 1>",
key_identifier: "<key-id 1>",
is_current: true,
},
{
key: "<key 2>",
key_identifier: "<key-id 2>",
is_current: true,
},
];

mockAgent.disableNetConnect();
const mockPool = mockAgent.get("https://api.github.com");
mockPool
Expand Down

0 comments on commit 4828168

Please sign in to comment.