Skip to content

chore: vitestによるテスト基盤を導入#83

Merged
KinjiKawaguchi merged 5 commits into
developfrom
chore/test-infrastructure
Mar 12, 2026
Merged

chore: vitestによるテスト基盤を導入#83
KinjiKawaguchi merged 5 commits into
developfrom
chore/test-infrastructure

Conversation

@KinjiKawaguchi

@KinjiKawaguchi KinjiKawaguchi commented Mar 12, 2026

Copy link
Copy Markdown
Member

Summary

  • vitest v4をdevDependenciesに追加し、npm test / npm run test:watch スクリプトを追加
  • vitest.config.tsでパスエイリアス(#domain, #application, #infrastructure)を解決
  • ValueObject基底クラスのユニットテストをサンプルとして追加(8テストケース)
  • GitHub Actions test.ymlワークフローを追加(push/PR時に自動実行)

Test plan

  • npm test で8件のテストが全てパスすること
  • npx biome check がパスすること
  • GitHub Actions test workflowが正常に実行されること

🤖 Generated with Claude Code


Open with Devin

- vitest v4をdevDependenciesに追加
- vitest.config.tsでパスエイリアス解決を設定
- ValueObject基底クラスのユニットテストをサンプルとして追加
- GitHub Actions test.ymlワークフローを追加

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 12, 2026 05:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Vitest を用いたユニットテスト基盤を導入し、サンプルとして ValueObject のテスト追加と GitHub Actions での自動実行を可能にする変更です。

Changes:

  • Vitest を devDependencies に追加し、npm test / npm run test:watch を追加
  • vitest.config.ts を追加し、#domain / #application / #infrastructure のパスエイリアス解決を設定
  • ValueObject のユニットテスト(8ケース)と、CI 用の test.yml ワークフローを追加

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Vitest 設定(テスト対象とパスエイリアス)を追加
src/domain/base/ValueObject.test.ts ValueObject のサンプルユニットテストを追加
package.json Vitest 追加とテスト用 npm scripts を追加
package-lock.json Vitest/Vite 関連依存のロック更新
.github/workflows/test.yml push/PR 時に npm test を実行する CI を追加

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vitest.config.ts Outdated
Comment thread src/domain/base/ValueObject.test.ts Outdated
Comment thread tests/domain/base/ValueObject.test.ts Outdated
Comment thread package.json
KinjiKawaguchi and others added 3 commits March 12, 2026 14:35
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
npmパッケージの慣習に従い、src/からtests/に配置変更。
tsconfig.jsonのincludeにtestsを追加してエディタ補完を有効化。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- vitest.config.tsでfileURLToPathを使用しWindows互換性を確保
- equalsテスト名をJSON比較であることを明示する表現に修正
- package.jsonにengines.nodeフィールドを追加

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

Comment thread tsconfig.json
Comment thread vitest.config.ts
Comment thread tests/domain/base/ValueObject.test.ts
チーム合意が必要な変更のため、テストインフラPRのスコープ外とする。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KinjiKawaguchi KinjiKawaguchi merged commit 1506c3b into develop Mar 12, 2026
4 checks passed
@KinjiKawaguchi KinjiKawaguchi deleted the chore/test-infrastructure branch March 12, 2026 06:09
KinjiKawaguchi added a commit that referenced this pull request Mar 23, 2026
## Summary
- vitest v4をdevDependenciesに追加し、`npm test` / `npm run test:watch`
スクリプトを追加
- `vitest.config.ts`でパスエイリアス(`#domain`, `#application`,
`#infrastructure`)を解決
- `ValueObject`基底クラスのユニットテストをサンプルとして追加(8テストケース)
- GitHub Actions `test.yml`ワークフローを追加(push/PR時に自動実行)

## Test plan
- [x] `npm test` で8件のテストが全てパスすること
- [x] `npx biome check` がパスすること
- [x] GitHub Actions test workflowが正常に実行されること

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/su-its/core/pull/83"
target="_blank">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
  </picture>
</a>
<!-- devin-review-badge-end -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants