-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjest.setup.js
More file actions
18 lines (17 loc) · 848 Bytes
/
jest.setup.js
File metadata and controls
18 lines (17 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Polyfill TextEncoder/TextDecoder for Next.js 15 in Jest (jsdom lacks these)
const { TextEncoder, TextDecoder } = require('util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
// Mock next-runtime-env to avoid loading Next.js server stack (next/cache, etc.)
jest.mock('next-runtime-env', () => ({
PublicEnvProvider: ({ children }) => children,
useEnvContext: () => ({
NEXT_PUBLIC_PREMIUM_TOKEN_SYMBOL: 'FUSD',
NEXT_PUBLIC_PRODUCT_CONTRACT_ADDRESS: '0x0000000000000000000000000000000000000000',
NEXT_PUBLIC_FLIGHT_NFT_CONTRACT_ADDRESS: '0x0000000000000000000000000000000000000000',
NEXT_PUBLIC_AIRPORTS_WHITELIST: '',
NEXT_PUBLIC_AIRPORTS_BLACKLIST: '',
NEXT_PUBLIC_DEPARTURE_DATE_DATE_FROM: undefined,
NEXT_PUBLIC_DEPARTURE_DATE_MIN_DAYS: '14',
}),
}));