Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

バックエンドの処理で重要な処理の関数化・単体テスト #177

Open
knokmki612 opened this issue Feb 5, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@knokmki612
Copy link
Contributor

実装に注意を払う必要がある部分は関数を分離して考えられるケースでテストしたほうが安心

JSON ファイル名からトレーナーの名前を抽出する処理

const trainerNames = trainers.map(({ Key }) => Key.replace(/\.json$/, ""));

新しい手持ちポケモンの採番処理

trainer.pokemons.push({
id: (trainer.pokemons[trainer.pokemons.length - 1]?.id ?? 0) + 1,
nickname: "",
order,
name,
sprites: { front_default },
});

@knokmki612 knokmki612 added the enhancement New feature or request label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant