import { beforeAll, afterAll, beforeEach, vi } from 'vitest'

// Mock environment variables
beforeAll(() => {
  process.env.ENCRYPTION_KEY = 'test-encryption-key-32-chars-long'
  process.env.CREDENTIAL_ENCRYPTION_KEY = 'test-credential-encryption-key!!'
  process.env.SETTINGS_ENCRYPTION_KEY = 'test-settings-encryption-key!!!'
  process.env.NEXTAUTH_SECRET = 'test-secret'
  process.env.NEXTAUTH_URL = 'http://localhost:3000'
})

// Reset mocks between tests
beforeEach(() => {
  vi.clearAllMocks()
})

// Clean up after all tests
afterAll(() => {
  vi.restoreAllMocks()
})
