Skip to content

nightshift: test-gap — zero tests across 3,000 lines of Rust/TS code #1

@nightshift-micr

Description

@nightshift-micr

Test Gap Analysis — Veskforge

nightshift automated test coverage audit · test-gap task

Summary

Veskforge is a Tauri (Rust + React) desktop application for managing custom Vencord builds. The codebase has zero test files — no Rust tests, no TypeScript/React tests, no test framework configured.

Codebase Breakdown

Component Language Files Lines (approx) Tests
src-tauri/src/lib.rs Rust 1 ~1,700 0
src-tauri/src/main.rs Rust 1 6 0
src-tauri/build.rs Rust 1 3 0
src/App.tsx TSX 1 ~800 0
src/main.tsx TSX 1 8 0
src/App.css CSS 1 ~500
src/vite-env.d.ts TS 1 1
Total 7 source files ~3,000 0

Critical Test Gaps

🔴 HIGH — Zero Rust Tests in lib.rs

The 1,700-line Rust backend (src-tauri/src/lib.rs) contains the core business logic with zero #[test] or #[cfg(test)] blocks. Critical untested functions include:

  1. discover_plugin_entrypoint() — Scans directories for plugin entry points. Edge cases: symlinks, nested dirs, permission errors, multiple entrypoint files in one directory
  2. add_plugin() — Handles three source types (local file, local folder, git). Edge cases: duplicate names, invalid git URLs, path traversal
  3. build_vencord() — Orchestrates the entire build pipeline. Edge cases: missing tools, build failures, partial builds
  4. git_clone_or_pull() — Git operations with authentication. Edge cases: auth failures, network errors, dirty working trees
  5. apply_vesktop_state() — File system operations on Vesktop state. Edge cases: missing dirs, locked files, permission errors

Recommendation: Add #[cfg(test)] mod tests with unit tests for each of these functions. Start with the pure-logic functions (path manipulation, manifest serialization) which don't require Tauri runtime.


🔴 HIGH — No Integration Tests for Tauri Commands

The Tauri command handlers (#[tauri::command] functions) have no integration tests:

  • get_environment_status
  • add_plugin
  • remove_plugin
  • toggle_plugin
  • build
  • apply
  • set_update_policy
  • set_startup

These are the primary API surface and should have integration tests that verify the full command flow.

Recommendation: Use Tauri's testing utilities or write integration tests that mock AppHandle and verify command behavior.


🟡 MEDIUM — No UI/Component Tests for React Frontend

src/App.tsx is a 800-line React component with complex state management (plugin management, build status, Vesktop state selection). Zero component tests exist.

Key untested UI behaviors:

  • Plugin add/remove flow
  • Build trigger and status display
  • Source type switching (local file/folder/git)
  • Error state handling
  • Vesktop state candidate selection

Recommendation: Configure Vitest + React Testing Library (add @testing-library/react, jsdom) and write tests for the critical user flows. The project already has package.json dependencies for @testing-library/react and jsdom but no test files.


🟢 LOW — No Cargo.toml Dev Dependencies for Testing

The Rust Cargo.toml doesn't include test utilities like tempfile (for testing file operations), mockall (for mocking), or tokio test runtime.

Recommendation: Add test-only dependencies:

[dev-dependencies]
tempfile = "3"
assert_fs = "1"

Priority Recommendations

  1. Start with Rust unit tests for lib.rs — the backend is the core business logic
  2. Add Tauri command integration tests — verify the API surface
  3. Configure frontend testing — Vitest + React Testing Library are already in devDependencies
  4. Target 30% coverage initially — focus on the most critical paths (build pipeline, plugin management)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions