From 34118c068c3660d14b23ae4935ca4ec5380d7e6c Mon Sep 17 00:00:00 2001 From: Eric Cabrel TIOGO Date: Sat, 13 Jul 2024 23:55:20 +0200 Subject: [PATCH] fix: frontend test --- apps/web/jest.config.ts | 3 +++ apps/web/package.json | 2 +- .../src/components/home/newsletter/newsletter-form.test.tsx | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/web/jest.config.ts b/apps/web/jest.config.ts index 54a12ad..1fdf76c 100644 --- a/apps/web/jest.config.ts +++ b/apps/web/jest.config.ts @@ -2,6 +2,9 @@ import type { Config } from '@jest/types'; const config: Config.InitialOptions = { collectCoverageFrom: ['**/*.{js,jsx,ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'], + detectOpenHandles: true, + forceExit: true, + logHeapUsage: true, moduleNameMapper: { '\\.(css|less)$': '/tests/mocks/styleMock.js', '^.+\\.(jpg|jpeg|png|gif|webp|avif|svg)$': '/tests/mocks/fileMock.js', diff --git a/apps/web/package.json b/apps/web/package.json index 295050f..3e228b1 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -8,7 +8,7 @@ "dev": "next dev --port 7500", "lint": "next lint", "start": "next start", - "test": "dotenv -e .env.test -- jest --logHeapUsage" + "test": "dotenv -e .env.test -- jest" }, "dependencies": { "@apollo/client": "3.10.6", diff --git a/apps/web/src/components/home/newsletter/newsletter-form.test.tsx b/apps/web/src/components/home/newsletter/newsletter-form.test.tsx index cefdae6..5474e70 100644 --- a/apps/web/src/components/home/newsletter/newsletter-form.test.tsx +++ b/apps/web/src/components/home/newsletter/newsletter-form.test.tsx @@ -8,8 +8,6 @@ import { NewsletterForm } from './newsletter-form'; jest.mock('next/router', () => require('next-router-mock')); -// TODO - to be refactored soon -// eslint-disable-next-line jest/no-disabled-tests describe('Newsletter Form', () => { beforeEach(() => { // IntersectionObserver isn't available in test environment