import { describe, expect, it, vi } from 'vitest'; const nextServer = vi.hoisted(() => ({ redirect: vi.fn((url: URL) => ({ kind: 'redirect', url: url.toString() })), })); vi.mock('next/server', () => ({ NextResponse: { redirect: nextServer.redirect, }, })); describe('homepage favicon route', () => { it('redirects root favicon requests to the existing brand icon asset', async () => { const { GET } = await import('../../src/app/favicon.ico/route'); const response = GET(new Request('https://rentaldrivego.ma/favicon.ico')); expect(response).toEqual({ kind: 'redirect', url: 'https://rentaldrivego.ma/rentaldrivego.png' }); expect(nextServer.redirect).toHaveBeenCalledTimes(1); }); });