Audit project and setup testing/quality tooling#18
Conversation
Co-authored-by: ViVaLaDaniel <110051738+ViVaLaDaniel@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
📝 WalkthroughWalkthroughThis PR introduces testing and linting infrastructure to the project. It adds ESLint configuration, Husky pre-commit hooks with lint-staged, Vitest testing framework with jsdom environment, initial test coverage for utilities, and supporting package.json scripts and dependencies. A Russian project audit document is also included. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🤖 Fix all issues with AI agents
In `@vitest.config.ts`:
- Around line 4-9: Vitest config currently lacks path alias resolution, so
imports using "@/..." will fail; update the vitest.config.ts (the defineConfig
call) to add alias mapping or use the vite-tsconfig-paths plugin: either add a
resolve.alias entry mapping "@/": to your src directory inside the exported
defineConfig (so the plugins array and resolve are updated) or install and
include vite-tsconfig-paths in the plugins array so TypeScript "paths" from
tsconfig.json are honored during tests (adjust the plugins list and ensure
test.environment remains 'jsdom').
🧹 Nitpick comments (1)
PROJECT_AUDIT_RU.md (1)
24-26: Consider updating the audit to reflect the current PR's additions.The audit states that testing is completely absent and recommends adding Vitest + Husky/lint-staged, but this PR is actively implementing those exact recommendations. Consider updating these items to reflect their new status (e.g., marking them as "in progress" or "addressed") so the document stays accurate post-merge.
| export default defineConfig({ | ||
| plugins: [react()], | ||
| test: { | ||
| environment: 'jsdom', | ||
| }, | ||
| }) |
There was a problem hiding this comment.
Missing path alias configuration — @/ imports will break in future tests.
The project uses @/ path aliases extensively (e.g., @/components/ui/badge, @/lib/data). Without mirroring these in the Vitest config, any test that imports a module using @/ paths (or imports a module that transitively does) will fail to resolve.
This works today only because utils.test.ts uses a relative import, but it will become a blocker the moment you add component or integration tests.
🔧 Proposed fix — add path alias resolution
import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
+import path from 'path'
export default defineConfig({
plugins: [react()],
+ resolve: {
+ alias: {
+ '@': path.resolve(__dirname, './src'),
+ },
+ },
test: {
environment: 'jsdom',
},
})Alternatively, if a tsconfig.json with paths already exists, you can use vite-tsconfig-paths to keep it DRY.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export default defineConfig({ | |
| plugins: [react()], | |
| test: { | |
| environment: 'jsdom', | |
| }, | |
| }) | |
| import { defineConfig } from 'vitest/config' | |
| import react from '@vitejs/plugin-react' | |
| import path from 'path' | |
| export default defineConfig({ | |
| plugins: [react()], | |
| resolve: { | |
| alias: { | |
| '@': path.resolve(__dirname, './src'), | |
| }, | |
| }, | |
| test: { | |
| environment: 'jsdom', | |
| }, | |
| }) |
🤖 Prompt for AI Agents
In `@vitest.config.ts` around lines 4 - 9, Vitest config currently lacks path
alias resolution, so imports using "@/..." will fail; update the
vitest.config.ts (the defineConfig call) to add alias mapping or use the
vite-tsconfig-paths plugin: either add a resolve.alias entry mapping "@/": to
your src directory inside the exported defineConfig (so the plugins array and
resolve are updated) or install and include vite-tsconfig-paths in the plugins
array so TypeScript "paths" from tsconfig.json are honored during tests (adjust
the plugins list and ensure test.environment remains 'jsdom').
Created PROJECT_AUDIT_RU.md. Installed Vitest, setup testing, and configured Husky/lint-staged pre-commit hooks.
PR created automatically by Jules for task 2598171159531544724 started by @ViVaLaDaniel
Summary by CodeRabbit
Release Notes
Tests
Chores
Documentation