Skip to content

test(citations): add citation domain classifier unit tests - #248

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
Pallavikumarimdb:test/unit-tests-for-classifyDomain-and-hostname-helpers
Jun 12, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
Pallavikumarimdb:test/unit-tests-for-classifyDomain-and-hostname-helpers

Conversation

@Pallavikumarimdb

Copy link
Copy Markdown
Contributor

Summary

Adds Vitest coverage for classifyDomain, extractHostname, and normalizeDomain, including ordered precedence, suffix matching, list and TLD classifications, fallthrough behavior, and empty-context handling without changing classify.ts.

Related issue

Closes: #198

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@Pallavikumarimdb
Pallavikumarimdb marked this pull request as ready for review June 12, 2026 13:51

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally: 13/13 tests pass, typecheck/lint/format clean. Assertions checked against classify.ts including the tricky cases (ac.uk generic pattern, edu.tr, mailto→null, whitespace→null, brand>competitor precedence). Clean, focused, no source changes. Thanks!

@gkhngyk
gkhngyk merged commit 093b5a3 into ansvisor:main Jun 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(citations): unit tests for classifyDomain and hostname helpers

2 participants