traPtitech / traPtitech/Checkin
Vue の単一ファイルコンポーネントをテストする手段を用意する
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 7
Description
現状
.vue の描画を確かめる手段がこのリポジトリに無い。2026-09-18 に feat/merge-auth-collection の d8feaca で確かめたところ、次のとおりだった。
@vue/test-utils・@nuxt/test-utils・happy-dom・jsdom・@testing-library/vue・@vitejs/plugin-vueのいずれも、リポジトリのルートとapps/webのnode_modulesに存在しない。- ルートの
vitest.config.tsのincludeは['{apps,packages}/*/**/*.test.ts']で、.vueを対象にしていない。
このため、表示条件の分岐や日時の書式のように、テンプレートの中で決まるものは型の検査でしか確かめられない。現状は、導出を apps/web/app/composables/ の関数へ切り出して純粋関数としてテストする形で迂回している(useListPagination.ts がその例)。
誰が何を誤るか
画面の分岐を変える人が、変更が描画に及ぼす影響をテストで確かめられない。切り出しで迂回できるのは導出だけで、テンプレートの v-if の条件やスロットの受け渡しはこの方法では確かめられないため、その部分の回帰は手で画面を開くまで出ない。
決めること
- 描画をテストする手段を入れるか、切り出しによる迂回を方針として明文化するか。
- 入れる場合、DOM の実装(
happy-domかjsdom)と、Nuxt の自動 import・コンポーネント解決をどう与えるか(@nuxt/test-utilsを使うか、@vitejs/plugin-vueと手動のスタブで足りるか)。 vitest.config.tsのincludeと環境の設定を、既存の*.test.tsの実行を遅くしない形にできるか。
直さずに残した理由
依存を足す判断で、実行時間と保守の負担が増える。描画のテストが要るかどうかは、上に挙げた「切り出しで迂回する」方針を続けるかどうかの判断と一体になっている。
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the root vitest.config.ts and apps/web/app/composables/useListPagination.ts, then inspect how existing *.test.ts files are run. Compare the repository's need for .vue rendering checks with the proposed extraction-based workaround and the listed test dependencies. Done means the project has a decided, documented testing approach and the relevant configuration or policy is in place.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100