Files
portfolio/app/__tests__/api/tech-stack.test.tsx
denshooter a5dba298f3
Some checks failed
Dev Deployment (Zero Downtime) / deploy-dev (push) Failing after 9m26s
feat: major UI/UX overhaul, snippets system, and performance fixes
2026-02-16 12:31:40 +01:00

21 lines
605 B
TypeScript

import { NextResponse, NextRequest } from "next/server";
import { GET } from "@/app/api/tech-stack/route";
// Mock the route handler module
jest.mock("@/app/api/tech-stack/route", () => ({
GET: jest.fn(),
}));
describe("GET /api/tech-stack", () => {
it("should return tech stack", async () => {
(GET as jest.Mock).mockResolvedValue(
NextResponse.json({ techStack: [{ id: 1, name: "Frontend" }] })
);
const response = await GET({} as NextRequest);
const data = await response.json();
expect(response.status).toBe(200);
expect(data.techStack).toHaveLength(1);
});
});