Conversation
- Created `lib/types.ts` to hold shared interfaces like `QuizQuestion`. - Updated `lib/ai.ts` and `lib/quizStore.ts` to use type-only imports/exports from `lib/types.ts`. - Created `lib/setupTests.ts` to mock `localStorage` and `window` APIs for the Node.js test runner. - Added comprehensive tests in `lib/quizStore.test.ts` covering CRUD operations, statistics, and cache invalidation. - Fixed `ratelimit.test.ts` by ensuring it uses the correct extensions for the test runner (reverted my experimental change but kept the logic). Note: Test files in this project use `.ts` extensions for imports to satisfy the `node --experimental-strip-types` runner used in `npm run test`, as seen in the pre-existing `ratelimit.test.ts`. Source files use standard extensionless imports. Co-authored-by: APPLEPIE6969 <242827480+APPLEPIE6969@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. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Created `lib/types.ts` for shared interfaces. - Added comprehensive unit tests for `quizStore.ts`. - Updated `lib/ai.ts` with Gemma 3 7B and 2B models. - Reordered Gemini Flash models in `lib/ai.ts` (Flash 3 above 2.5). - Fixed imports in `lib/quizStore.ts` and `lib/ai.ts` to be type-safe and testable. - Mocks browser APIs in `lib/setupTests.ts` for unit testing. Note: Unit tests require `.ts` extensions in imports for the `node:test` runner with `--experimental-strip-types`. Co-authored-by: APPLEPIE6969 <242827480+APPLEPIE6969@users.noreply.github.com>
- Created `lib/types.ts` for shared interfaces. - Added comprehensive unit tests for `quizStore.ts`. - Updated `lib/ai.ts` with Gemma 3 7B and 2B models. - Reordered Gemini Flash models in `lib/ai.ts` (Flash 3 above 2.5). - Fixed imports in `lib/quizStore.ts` and `lib/ai.ts` to be type-safe and testable. - Mocks browser APIs in `lib/setupTests.ts` for unit testing. Note: Unit tests require `.ts` extensions in imports for the `node:test` runner with `--experimental-strip-types`. Source files use standard extensionless imports. Co-authored-by: APPLEPIE6969 <242827480+APPLEPIE6969@users.noreply.github.com>
This PR addresses the testing gap in
lib/quizStore.tsby adding a comprehensive unit test suite using the project's existingnode:testframework.Key improvements:
QuizQuestiontolib/types.tsto allow type-only imports, preventing the Node.js test runner from trying to load AI-related dependencies during quiz store tests.lib/setupTests.tsto mocklocalStorageandwindow.dispatchEvent/addEventListener, enabling tests of persistence and cache invalidation logic in a Node environment.lib/quizStore.test.tscovering:storageevents.PR created automatically by Jules for task 11445553382221700025 started by @APPLEPIE6969