| import { describe, it, before, after } from "node:test";
|
| import assert from "node:assert";
|
| import { NextRequest } from "next/server";
|
| import { GET } from "../../../../src/app/api/cli-tools/detect/route.ts";
|
|
|
| describe("GET /api/cli-tools/detect", () => {
|
| it("returns 401 without authorization", async () => {
|
|
|
| const req = new NextRequest("http://localhost:3000/api/cli-tools/detect");
|
| const res = await GET(req);
|
| assert.strictEqual(res.status, 401);
|
| });
|
|
|
| it("returns 403 with wrong authorization (invalid API key)", async () => {
|
|
|
| const req = new NextRequest("http://localhost:3000/api/cli-tools/detect", {
|
| headers: { authorization: "Bearer wrong-key" },
|
| });
|
| const res = await GET(req);
|
| assert.strictEqual(res.status, 403);
|
| });
|
|
|
| it("returns 200 with valid auth and returns tools array", async () => {
|
|
|
|
|
|
|
| assert.ok(true);
|
| });
|
|
|
| it("returns single tool when tool query param provided", async () => {
|
|
|
| assert.ok(true);
|
| });
|
| });
|
|
|