Delete live-client.integration.test.ts

This commit is contained in:
Tasnim Kabir Sadik
2026-05-09 18:06:02 +06:00
parent f1522eaa0b
commit 52282618bd

View File

@ -1,85 +0,0 @@
import { beforeAll, describe, expect, it } from "vitest";
import { WrennClient } from "../../src/client.js";
import { DEFAULT_BASE_URL } from "../../src/config.js";
const baseUrl = process.env.WRENN_BASE_URL ?? DEFAULT_BASE_URL;
const apiKey = process.env.WRENN_API_KEY;
const testEmail = process.env.WRENN_TEST_EMAIL;
const testPassword = process.env.WRENN_TEST_PASS;
const describeWithApiKey = apiKey ? describe : describe.skip;
const describeWithLogin = testEmail && testPassword ? describe : describe.skip;
describeWithApiKey("WrennClient live API key integration", () => {
const client = new WrennClient({ apiKey, baseUrl });
it("lists capsules from the real Wrenn API", async () => {
const capsules = await client.capsules.list();
expect(Array.isArray(capsules)).toBe(true);
});
it("lists snapshot templates from the real Wrenn API", async () => {
const snapshots = await client.snapshots.list();
expect(Array.isArray(snapshots)).toBe(true);
});
it("gets capsule stats from the real Wrenn API", async () => {
const stats = await client.capsules.stats({ range: "1h" });
expect(stats).toBeTypeOf("object");
});
it("gets capsule usage from the real Wrenn API", async () => {
const usage = await client.capsules.usage();
expect(usage).toBeTypeOf("object");
});
});
describeWithLogin("WrennClient live login integration", () => {
let client: WrennClient;
beforeAll(async () => {
const authClient = new WrennClient({ baseUrl });
const auth = await authClient.auth.login({
email: testEmail as string,
password: testPassword as string,
});
expect(auth.token).toBeTypeOf("string");
client = new WrennClient({ baseUrl, token: auth.token });
});
it("gets the current account profile from the real Wrenn API", async () => {
const me = await client.account.getMe();
expect(me).toBeTypeOf("object");
});
it("lists teams from the real Wrenn API", async () => {
const teams = await client.teams.list();
expect(Array.isArray(teams)).toBe(true);
});
it("lists API keys from the real Wrenn API", async () => {
const keys = await client.apiKeys.list();
expect(Array.isArray(keys)).toBe(true);
});
it("lists notification channels from the real Wrenn API", async () => {
const channels = await client.channels.list();
expect(Array.isArray(channels)).toBe(true);
});
it("lists hosts from the real Wrenn API", async () => {
const hosts = await client.hosts.list();
expect(Array.isArray(hosts)).toBe(true);
});
});