feat: Add Vitest testing framework for frontend#50
Merged
dineshsutihar merged 2 commits intoStructZ:developfrom Oct 14, 2025
Merged
feat: Add Vitest testing framework for frontend#50dineshsutihar merged 2 commits intoStructZ:developfrom
dineshsutihar merged 2 commits intoStructZ:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces Vitest testing framework to the frontend package to enable automated testing and improve code quality assurance. The implementation includes a complete testing setup with mocked Chrome APIs for browser extension testing.
- Added Vitest configuration with jsdom environment for browser-like testing
- Created initial unit tests for cache functionality with Chrome Storage API mocking
- Updated package.json with testing dependencies and npm script
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontend/vitest.config.js | Configures Vitest with jsdom environment and global test utilities |
| frontend/scripts/cache.test.js | Implements comprehensive unit tests for cache functions with Chrome API mocking |
| frontend/package.json | Adds Vitest and jsdom dependencies plus test script |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #42
This PR introduces an automated testing framework for the frontend extension using Vitest, ensuring code quality and preventing regressions.
Changes Made:
jsdomto thefrontendpackage and created avitest.config.jsfile.cache.test.js) to validate caching logic and mock the Chrome Storage API..github/workflows/test.yml) that automatically runsnpm teston every pull request to themainanddevelopbranches.Please enable a branch protection rule for the
mainanddevelopbranches with the following setting:frontend-testsjob as a required check.This will ensure the long-term stability of the project. Thanks!