Add integration tests for CurseForge and Modrinth APIs

This commit is contained in:
CPTProgrammer 2026-07-10 09:58:20 +08:00
parent 29e1751d31
commit 58d72d06fe
No known key found for this signature in database
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import { describe, expect, test } from "vitest";
import { CurseForgeClient } from "./client";
import { getVersionTypes, getGameVersions } from "./game";
import secrets from "../../../secrets.json";
const client = new CurseForgeClient(secrets.curseforge);
describe("getVersionTypes", () => {
test("GET /api/game/version-types", async () => {
const types = await getVersionTypes(client);
expect(types.length).toBeGreaterThan(0);
});
});
describe("getGameVersions", () => {
test("GET /api/game/versions", async () => {
const versions = await getGameVersions(client);
expect(versions.length).toBeGreaterThan(0);
});
});

View File

@ -0,0 +1,20 @@
import { describe, expect, test } from "vitest";
import { ModrinthClient } from "./client";
import { getLoaders, getGameVersions } from "./tag";
import secrets from "../../../secrets.json";
const client = new ModrinthClient(secrets.modrinth, "ModReleaser (local)");
describe("getLoaders", () => {
test("GET /tag/loader", async () => {
const loaders = await getLoaders(client);
expect(loaders.length).toBeGreaterThan(0);
});
});
describe("getGameVersions", () => {
test("GET /tag/game_version", async () => {
const versions = await getGameVersions(client);
expect(versions.length).toBeGreaterThan(0);
});
});