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

未关闭 适合新手
#15 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
testing

调研方向

阅读 src/locales/index.ts 和 src/locales/types.ts,了解内置 locale 的结构和 pool 数组,然后查看现有测试的惯例。添加 tests/locales/data-integrity.test.ts,针对每个 locale 检查指定字段、去除首尾空白后非空的字符串以及重复项;运行相关测试命令。完成标准:每个内置 locale 都有覆盖,且失败信息能指出对应的 locale。

由索引模型根据 Issue 内容生成。

描述

enhancement good first issue hacktoberfest

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.

主要语言
TypeScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SahinurDEV/ForgeData 的其他 Issue

查看 SahinurDEV/ForgeData 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。