tests/domainDiscovery.test.ts — 17 lines, 2 tests. Targets findCompanyDomain() from src/enrichment/sources/domain.ts. See Domain Discovery.
What it covers
- Rejects known hosting provider
180.sefor queryPontán Uppsala AB / 5569810061 / Örsundsbro - Rejects municipality domain
uppsala.sefor queryTMP I Uppsala AB / 5565478202 / Uppsala
Both assertions are not.toBe(...) — they verify the validation guard does NOT return the bad domain. They do not assert what the correct domain is.
Gaps
- No assertion of the positive case (correct domain returned for a known company)
- No mocking of Serper — these tests will hit the live Serper.dev API if no cache hit
- No coverage of:
- Registry-tier lookup (covered separately in
tests/speed.test.ts) - Domain-name fuzzing
- Multi-domain candidate ranking
- Bisnode-style fallback
- The 4 root causes documented in
docs/ENRICHMENT_FAILURE_ANALYSIS_2026-03-25.md(especially business-type checking)
- Registry-tier lookup (covered separately in
Warning
A test failure here may mean the API key is missing or rate-limited rather than a real regression. There is no offline mode.
See also
Test Strategy, Domain Discovery, Speed Tests, Known Issues.