Skip to content

Introduction

VitestDedup is a static analyzer that finds duplicate and near-duplicate Vitest tests.

It reads project configuration and test files without importing or executing either one. A test’s identity is its body: two tests that do the same thing under different titles are duplicates, and two textually identical bodies that run under different hooks, mocks, or fixtures are not.

Copy-pasting a test and tweaking a value is fast today and expensive tomorrow. Duplicated tests make refactors touch the same logic several times, inflate CI time, and blur which test is authoritative.

VitestDedup surfaces that duplication deliberately: it names what each finding claims — a verdict with a remedy — and the decision to consolidate stays with you. It never edits or deletes your tests.

  • Installation — add the analyzer to a project, or run it once without installing.
  • Quick Start — your first analysis run and what to do with its findings.
  • Detection Concepts — the rules, how bodies are normalized, and what a verdict claims.
  • CI Integration — thresholds, baselines, and the GitHub Action.
  • Analyzer Reference — the complete upstream documentation, synced from the source repository.
Current version See the changelog
License MIT
Runtime Node 20 or later launches the analyzer binary; the analysis itself runs without importing your code
Platforms macOS (arm64, x64), Linux (arm64, x64; glibc and musl), Windows (arm64, x64)
Source figueiredoluiz/vitest-dedup