mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-23 00:35:51 +00:00
test: 新增数据层测试 + 引擎修复
- 新增 pkmn.test.ts: stat 映射测试 - 新增 species.test.ts: 物种数据测试 - 新增 xpTable.test.ts: XP 公式测试 - 新增 evMapping.test.ts: EV 映射测试 - 新增 names.test.ts: 多语言名称测试 - 新增 fallback.test.ts: 精灵 fallback 测试 - 修复 engine.ts 类型 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
44
packages/pokemon/src/__tests__/names.test.ts
Normal file
44
packages/pokemon/src/__tests__/names.test.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { describe, test, expect } from 'bun:test'
|
||||
import { SPECIES_NAMES, SPECIES_I18N, SPECIES_PERSONALITY } from '../data/names'
|
||||
import { ALL_SPECIES_IDS } from '../types'
|
||||
|
||||
describe('SPECIES_NAMES', () => {
|
||||
test('has name for every species', () => {
|
||||
for (const id of ALL_SPECIES_IDS) {
|
||||
expect(SPECIES_NAMES[id]).toBeTruthy()
|
||||
}
|
||||
})
|
||||
|
||||
test('Charmander name is correct', () => {
|
||||
expect(SPECIES_NAMES.charmander).toBe('Charmander')
|
||||
})
|
||||
})
|
||||
|
||||
describe('SPECIES_I18N', () => {
|
||||
test('has i18n for every species', () => {
|
||||
for (const id of ALL_SPECIES_IDS) {
|
||||
expect(SPECIES_I18N[id]).toBeTruthy()
|
||||
expect(SPECIES_I18N[id]!.en).toBeTruthy()
|
||||
}
|
||||
})
|
||||
|
||||
test('has Chinese translations', () => {
|
||||
expect(SPECIES_I18N.pikachu!.zh).toBe('皮卡丘')
|
||||
expect(SPECIES_I18N.squirtle!.zh).toBe('杰尼龟')
|
||||
})
|
||||
})
|
||||
|
||||
describe('SPECIES_PERSONALITY', () => {
|
||||
test('has personality for every species', () => {
|
||||
for (const id of ALL_SPECIES_IDS) {
|
||||
expect(SPECIES_PERSONALITY[id]).toBeTruthy()
|
||||
}
|
||||
})
|
||||
|
||||
test('personality is non-empty string', () => {
|
||||
for (const id of ALL_SPECIES_IDS) {
|
||||
expect(typeof SPECIES_PERSONALITY[id]).toBe('string')
|
||||
expect(SPECIES_PERSONALITY[id]!.length).toBeGreaterThan(0)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user