platform-codebase/features/cms/backend-api/test/vitest-setup.ts

24 lines
568 B
TypeScript

/**
* Vitest Global Setup for CMS Backend API
*
* Configures test environment variables and resets mocks between tests.
*/
import { beforeEach, vi } from 'vitest'
// Environment
process.env.NODE_ENV = 'test'
process.env.LANDING_API_URL = 'http://localhost:3010'
process.env.DATABASE_POSTGRES_USER = 'test'
process.env.DATABASE_POSTGRES_PASSWORD = 'test'
process.env.DATABASE_POSTGRES_NAME = 'test_cms'
beforeEach(() => {
vi.clearAllMocks()
})
declare global {
// eslint-disable-next-line no-var
var vi: typeof import('vitest')['vi']
}
globalThis.vi = vi