Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dev": "tsc --watch",
"start": "node dist/index.js",
"test": "vitest run",
"test:integration": "vitest run tests/integration/",
"test:watch": "vitest",
"lint": "tsc --noEmit",
"prepublishOnly": "npm run build"
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { OSTClient } from "../../src/client.js";

const INTEGRATION_API_URL =
process.env.OST_API_URL || "http://localhost:8000";

export function createIntegrationClient(): OSTClient {
return new OSTClient(INTEGRATION_API_URL);
}
27 changes: 27 additions & 0 deletions tests/integration/smoke.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { describe, it, expect } from "vitest";
import { createIntegrationClient } from "./setup.js";

const client = createIntegrationClient();

describe("Integration smoke tests", () => {
it("lists categories from the local API", async () => {
const categories = await client.listCategories();

expect(Array.isArray(categories)).toBe(true);
expect(categories.length).toBeGreaterThan(0);
});

it("lists domains from the local API", async () => {
const domains = await client.listDomains();

expect(Array.isArray(domains)).toBe(true);
expect(domains.length).toBeGreaterThan(0);
});

it("lists tech stacks from the local API", async () => {
const techStacks = await client.listTechStacks();

expect(Array.isArray(techStacks)).toBe(true);
expect(techStacks.length).toBeGreaterThan(0);
});
});
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export default defineConfig({
test: {
globals: true,
environment: "node",
exclude: ["tests/integration/**", "node_modules/**"],
},
});
Loading