backend phase 15 & frontend phase 8
This commit is contained in:
@@ -5,6 +5,11 @@
|
||||
// Learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// next/jest loads .env / .env.test but not .env.development, so NEXT_PUBLIC_API_URL (required by
|
||||
// `@/config`) is absent in tests. Any test that renders a component using a `services/{domain}` hook pulls
|
||||
// the real `clientApi` → `@/config` at import time, which throws without this. Provide a harmless default.
|
||||
process.env.NEXT_PUBLIC_API_URL = process.env.NEXT_PUBLIC_API_URL || 'https://localhost:5002';
|
||||
|
||||
// To get 'next/router' working with tests
|
||||
jest.mock('next/router', () => require('next-router-mock'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user