Sharkey/packages/backend/test
okayurisotto 750d262604
refactor(backend): ReactionService.prototype.convertLegacyReactions (#13375)
* add unit tests

* cleanup unnecessary type assertions

* `convertedReaction`変数の定義と変換表に対する存在確認処理の整理

* `count`変数の定義とループ処理での`Object.entries()`の活用

* 条件式の整理

* `Array.prototype.reduce`を使うように

* `Array.prototype.reduce`を使うように

* 配列操作を1つのメソッドチェーンに整理

これまでの実装では、`decodeReaction`の返り値が同一になる異なる入力値が同時に複数個存在した場合、後ろのもので上書きされてしまっていたはず。
これからの実装では、後ろのものは前のものに加算される。
(実際にこの挙動の変更が問題になるシチュエーションはまずないはず。)

* add unit test

* ドキュメントコメントの追加と型定義の調整
2024-02-21 14:31:50 +09:00
..
e2e Merge pull request from GHSA-qqrm-9grj-6v32 2024-02-17 12:41:19 +09:00
misc (re) update SPDX-FileCopyrightText 2024-02-13 15:59:27 +00:00
prelude (re) update SPDX-FileCopyrightText 2024-02-13 15:59:27 +00:00
resources [fix] .wav .flac ファイルを再生可能にする (#10686) 2023-04-26 02:17:58 +09:00
unit refactor(backend): ReactionService.prototype.convertLegacyReactions (#13375) 2024-02-21 14:31:50 +09:00
.eslintrc.cjs なんかもうめっちゃ変えた 2022-09-18 03:27:08 +09:00
docker-compose.yml chore(workflows): use postgres 15 everywhere (#12726) 2023-12-21 10:29:51 +09:00
jest.setup.ts enhance(backend): テストの高速化 (#12939) 2024-01-08 17:43:52 +09:00
tsconfig.json update deps (#11764) 2023-09-04 13:33:38 +09:00
utils.ts Merge pull request from GHSA-qqrm-9grj-6v32 2024-02-17 12:41:19 +09:00