Skip to content

Conversation

singhxabhijeet
Copy link
Contributor

Resolves #42

This PR introduces an automated testing framework for the frontend extension using Vitest, ensuring code quality and preventing regressions.

Changes Made:

  • Testing Framework: Added Vitest and jsdom to the frontend package and created a vitest.config.js file.
  • Initial Unit Tests: Created the first test file (cache.test.js) to validate caching logic and mock the Chrome Storage API.
  • CI Automation: Created a new workflow (.github/workflows/test.yml) that automatically runs npm test on every pull request to the main and develop branches.

Please enable a branch protection rule for the main and develop branches with the following setting:

  • Require status checks to pass before merging
    • Select the frontend-tests job as a required check.

This will ensure the long-term stability of the project. Thanks!

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Collaborator

@dineshsutihar dineshsutihar left a comment

Choose a reason for hiding this comment

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

LGTM

@dineshsutihar dineshsutihar merged commit 6e5ef41 into StructZ:develop Oct 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Set up automated testing framework for the extension

2 participants