Conversation
- vite.config.ts: set default environment to `node` - add `// @vitest-environment jsdom` to 3 files referencing DOM APIs - remove @testing-library/svelte and @testing-library/jest-dom (0 imports) - compose.yaml: use named volume for node_modules to avoid virtiofs overhead - .claude/rules/testing.md: document per-file jsdom opt-in rule - docs/dev-notes/2026-07-11/build-performance: add survey and TODO with measurements wall clock 33.3s → 11.3s (2.9x); environment cumulative 161s → 5.7s Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Named volume's initial mount is an empty root-owned directory, which causes EACCES when the node user runs pnpm install under the `.:/usr/src/app` bind mount. The layering of bind mount + named volume doesn't allow Docker image initialization to populate it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Investigation and TODO items are done; findings already folded into prior commits (compose.yaml revert, dependency prune). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughVitestの既定環境を ChangesVitest環境とストアテスト
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/features/tasks/stores/active_contest_type.svelte.test.ts`:
- Around line 1-2: Remove the `@vitest-environment` jsdom annotation from
src/features/tasks/stores/active_contest_type.svelte.test.ts:1-2,
src/features/workbooks/stores/replenishment_workbook.test.ts:1-2, and
src/test/lib/stores/active_problem_list_tab.svelte.test.ts:1-2. Verify the
associated store tests use only mocked localStorage and have no window or
document dependencies so they run with Vitest’s default node environment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 71c54fa8-699d-4d16-b81f-a05fdea85cb8
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!pnpm-lock.yaml
📒 Files selected for processing (7)
.claude/rules/testing.mdcompose.yamlpackage.jsonsrc/features/tasks/stores/active_contest_type.svelte.test.tssrc/features/workbooks/stores/replenishment_workbook.test.tssrc/test/lib/stores/active_problem_list_tab.svelte.test.tsvite.config.ts
💤 Files with no reviewable changes (1)
- package.json
…se in store tests
Each store test file registered `$app/environment` twice (top-level
`{browser:true}` plus an SSR-describe `{browser:false}`). vi.mock calls
are hoisted and the last registration for a module wins, so every test
in these files silently ran with browser=false — the localStorage
branches in ActiveContestTypeStore, ReplenishmentWorkBooksStore, and
ActiveProblemListTabStore never executed, and the "invalid localStorage
key" tests were false-positives.
Replace the double registration with a single vi.mock using a
vi.hoisted flag toggled per describe, and use jsdom's real Storage
instead of a vi.stubGlobal mock so assertions can check actual
persisted state. Un-skip the replenishment persistence test (its
skip comment blamed jsdom, not the real cause). Export
ReplenishmentWorkBooksStore so tests can construct fresh instances
for the invalid-JSON catch branch. Document the pitfall in
testing.md.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Implementation and verification already landed in fbd1349. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@coderabbitai review |
|
✅ Action performedReview triggered.
|
…ssertions Follow-up to fbd1349's testing.md addition. Two more pitfalls found while applying the pattern: asserting a browser branch against the import-time singleton is the same false-positive as the double-mock issue (the singleton is always built with browser=false), and a single assertion can't cover both the localStorage read guard and write guard — they need separate cases. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
close #3847
Summary by CodeRabbit
nodeに変更し、DOM依存テストは各ファイルでjsdomを明示して有効化。localStorageを実環境(jsdom)に基づいて検証するよう改善。