Open History to see the last commit
1import { expect, it } from 'vitest'
2
3import { providerRegistry } from './index.ts'
4
5// Two claimants make a namespace ambiguous, and a provider id always beats a
6// namespace of the same name: either would silently drop sameAs links.
7it('claims each model namespace once and never shadows a provider id', () => {
8 const ids = new Set(providerRegistry.map((p) => p.id))
9 const claimed = providerRegistry.flatMap((p) => p.modelNamespaces ?? [])
10 expect(claimed).toEqual(expect.arrayContaining(['google', 'x-ai', 'xai']))
11 expect(new Set(claimed).size).toBe(claimed.length)
12 expect(claimed.filter((namespace) => ids.has(namespace))).toEqual([])
13})