From 2098c3cdb23e3493a154047d9a84ee533c7711bb Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Sun, 14 Jan 2024 21:50:57 -0600 Subject: [PATCH] feat!: Remove manual API calling tests These tests are no longer used since the switch to OctokitWrapper, and conflict with packages required for the implementation of throttling, so remove them. --- test/utils.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/test/utils.ts b/test/utils.ts index e4209ab..5f3de85 100644 --- a/test/utils.ts +++ b/test/utils.ts @@ -1,5 +1,3 @@ -import fetch from "node-fetch" - export function getToken(first: boolean): string { const token = process.env["GITHUB_TOKEN"] || "" if (!token && first) { @@ -12,31 +10,3 @@ export function getToken(first: boolean): string { return token } - -/** - * Retrieves the release from a GitHub repository. This function allows to fetch - * either the latest release or the latest pre-release ("edge" release). - * - * @param {string} repo - The GitHub repository to fetch the release from, - * in the format 'owner/repo'. - * @param {boolean} [prerelease] - If true, fetches the latest pre-release. - * If false or undefined, fetches the latest release regardless of whether - * it's a pre-release or not. - * - * @returns {Promise} A Promise that resolves to a string representing the tag name - * of the found release. If no release is found, the Promise resolves to 'Release not found'. - */ -export async function getReleaseTag( - repo: string, - prerelease?: boolean -): Promise { - const response = await fetch(`https://api.github.com/repos/${repo}/releases`) - const releases = await response.json() - - const release = releases.find( - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ - (rel: any) => prerelease === undefined || rel.prerelease === prerelease - ) - - return release ? release.tag_name : "No release found" -}