From ac8d27ae058a884c990f3d89dc253ce809f45d19 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 1 Dec 2025 16:19:27 +0100 Subject: [PATCH] fix: resolve ESLint warning and silence test console output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace with Next.js in not-found.tsx - Add console mock in jest.setup.js to silence logs during tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/not-found.tsx | 6 +++++- jest.setup.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/not-found.tsx b/app/not-found.tsx index 4e7daaa..603e5dc 100644 --- a/app/not-found.tsx +++ b/app/not-found.tsx @@ -1,6 +1,7 @@ "use client"; import Link from "next/link"; +import Image from "next/image"; import { useRouter } from "next/navigation"; export default function NotFound() { @@ -12,10 +13,13 @@ export default function NotFound() { {/* Logo and 404 */}
- Thé Tip Top Logo
diff --git a/jest.setup.js b/jest.setup.js index e4bfeb0..0924364 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -1,6 +1,20 @@ // Learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; +// Silence console output during tests +const originalConsole = { ...console }; +beforeAll(() => { + jest.spyOn(console, 'log').mockImplementation(() => {}); + jest.spyOn(console, 'warn').mockImplementation(() => {}); + jest.spyOn(console, 'error').mockImplementation(() => {}); +}); + +afterAll(() => { + console.log = originalConsole.log; + console.warn = originalConsole.warn; + console.error = originalConsole.error; +}); + // Mock Next.js router jest.mock('next/navigation', () => ({ useRouter() {