import { describe, it, expect } from 'vitest' import { loadReferencesConfig, reloadReferencesConfig } from '../../../../app/services/references/config_loader.js' describe('config_loader', () => { it('loadReferencesConfig loads config from file', () => { const config = loadReferencesConfig() expect(config).toBeDefined() expect(config.providers).toBeInstanceOf(Array) expect(config.providers.length).toBeGreaterThan(0) expect(config.providers[0].name).toBe('wassup') }) it('loadReferencesConfig returns cached result on second call', () => { const a = loadReferencesConfig() const b = loadReferencesConfig() expect(a).toBe(b) // same reference (cached) }) it('reloadReferencesConfig clears cache and reloads', () => { const a = loadReferencesConfig() const b = reloadReferencesConfig() expect(b.providers).toBeInstanceOf(Array) // After reload, a new object is returned expect(b).not.toBe(a) }) })