Add integration tests for CurseForge and Modrinth APIs
This commit is contained in:
parent
29e1751d31
commit
58d72d06fe
20
src/lib/curseforge/game.test.ts
Normal file
20
src/lib/curseforge/game.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
20
src/lib/modrinth/tag.test.ts
Normal file
20
src/lib/modrinth/tag.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user