Skip to content

test: add a data-integrity test for every built-in locale #15

Open

Description

@SahinurDEV

Locale data (src/locales/*.ts) is only checked indirectly (registry tests + a few module tests). Nothing guarantees that every built-in locale has every pool populated, so a new or edited locale could ship an empty array (making generators return undefined) or accidental duplicates without failing CI.

What to do

Add tests/locales/data-integrity.test.ts that iterates over builtInLocales (exported from src/locales/index.ts) and asserts, for each locale:

  • code matches its key in builtInLocales and name is non-empty
  • every array in person, location, company and lorem (see src/locales/types.ts) is non-empty and contains only non-empty, trimmed strings
  • no duplicate entries within a pool (or document why duplicates are intentional)

Use describe.each / it.each so failures name the locale. This also makes future locale PRs (e.g. #12) self-validating.

PR title: test(locale): add data-integrity checks for built-in locales.

Activity

  1. added
    enhancement
    good first issue
    hacktoberfest
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehacktoberfest

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions