1+ import { createEnvMock } from '@sim/testing'
12import { afterEach , describe , expect , it , vi } from 'vitest'
23
3- vi . mock ( '@/lib/core/config/env' , ( ) => ( {
4- env : {
4+ vi . mock ( '@/lib/core/config/env' , ( ) =>
5+ createEnvMock ( {
56 NEXT_PUBLIC_APP_URL : 'https://example.com' ,
67 NEXT_PUBLIC_SOCKET_URL : 'https://socket.example.com' ,
78 OLLAMA_URL : 'http://localhost:11434' ,
@@ -13,20 +14,8 @@ vi.mock('@/lib/core/config/env', () => ({
1314 NEXT_PUBLIC_BRAND_FAVICON_URL : 'https://brand.example.com/favicon.ico' ,
1415 NEXT_PUBLIC_PRIVACY_URL : 'https://legal.example.com/privacy' ,
1516 NEXT_PUBLIC_TERMS_URL : 'https://legal.example.com/terms' ,
16- } ,
17- getEnv : vi . fn ( ( key : string ) => {
18- const envMap : Record < string , string > = {
19- NEXT_PUBLIC_APP_URL : 'https://example.com' ,
20- NEXT_PUBLIC_SOCKET_URL : 'https://socket.example.com' ,
21- OLLAMA_URL : 'http://localhost:11434' ,
22- NEXT_PUBLIC_BRAND_LOGO_URL : 'https://brand.example.com/logo.png' ,
23- NEXT_PUBLIC_BRAND_FAVICON_URL : 'https://brand.example.com/favicon.ico' ,
24- NEXT_PUBLIC_PRIVACY_URL : 'https://legal.example.com/privacy' ,
25- NEXT_PUBLIC_TERMS_URL : 'https://legal.example.com/terms' ,
26- }
27- return envMap [ key ] || ''
28- } ) ,
29- } ) )
17+ } )
18+ )
3019
3120vi . mock ( '@/lib/core/config/feature-flags' , ( ) => ( {
3221 isDev : false ,
0 commit comments