Skip to content

[NREM][Space] Set up testing infrastructure (Vitest + React Testing Library) #65

@numbers-official

Description

@numbers-official

Summary

The ProofSnap extension has zero test files, no test runner, and no testing libraries in its dependencies. All quality assurance currently relies on manual testing, TypeScript type checking, and AI-assisted code review. This gap was visible in PR #9 where code quality issues (untrimmed inputs, accessibility gaps, security flaws) were caught only during human/Copilot review rather than automated tests.

Evidence

Proposed Approach

  1. Install Vitest — aligns with the existing Vite build system, zero-config for Vite projects
  2. Install React Testing Library — for popup/options UI component tests
  3. Add chrome API mocks — stub chrome.storage, chrome.runtime, chrome.tabs for unit tests
  4. Create initial test suites for critical paths:
    • StorageService — auth token management, settings persistence
    • IndexedDBService — asset CRUD operations
    • UploadService — queue management, retry logic, error recovery
    • AuthService — login/logout flows, token handling
  5. Add test script to package.json
  6. Integrate into CI — add test step to the release workflow and future PR checks

Priority

High — testing infrastructure is foundational. Without it, every PR relies entirely on manual verification, increasing the risk of regressions as the codebase grows.

Generated by NREM Mode with Omni

Metadata

Metadata

Assignees

No one assigned

    Labels

    nremNREM Mode findingnrem:improvementGeneral improvementnrem:spaceSpace-level nrem finding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions