Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Test Effectiveness Checker

Test Effectiveness Checker is a small VS Code extension MVP for spotting likely weak JavaScript and TypeScript unit tests. It scans only the current Jest/Vitest-style test file and surfaces deterministic findings in the Problems panel plus a lightweight summary view.

Current Features

  • Scan the currently active JavaScript or TypeScript test file with the TestEffectiveness: Scan Current Test File command.
  • Detect likely weak tests with deterministic rules for weak assertions, happy-path bias, and mocking risk.
  • Surface findings in native VS Code diagnostics so results appear in the Problems panel and jump to the relevant location.
  • Show a lightweight side-panel summary with the current file name, grouped finding counts, and finding details.
  • Support common Jest and Vitest-style test patterns for local, current-file analysis.
  • Validate rule behavior with fixture-driven unit tests under fixtures/.

Future Features

These are future-looking capabilities summarized from PRD.md and IMPLEMENTATION_SPEC.md. They are not all implemented today.

  • A quick effectiveness score with an overall file score, dimension breakdowns, and red/yellow/green status.
  • Targeted mutation checking for the production code related to the current test file.
  • AI-assisted repair suggestions that help strengthen weak tests after findings are detected.
  • Richer editor UX such as more navigable side-panel items, decorations, and other targeted in-editor feedback.
  • Expanded rule coverage beyond the initial three families, including more structural test smells and deeper behavior checks.

Setup

  1. Install dependencies:
npm install
  1. Build the extension:
npm run build
  1. Run tests:
npm run test
  1. Run lint:
npm run lint

Run In VS Code Extension Development Mode

  1. Open this folder in VS Code.
  2. Run npm install.
  3. Run npm run build.
  4. Press F5 to launch the Extension Development Host.
  5. In the host window, open a *.test.* or *.spec.* JS/TS file.
  6. Run TestEffectiveness: Scan Current Test File from the Command Palette.

This repo now includes a minimal debug configuration in .vscode/launch.json and a matching build task in .vscode/tasks.json, so F5 should build and launch the extension directly.

Current Rule Set

Weak assertions

  • WA001 Generic existence-only assertion
  • WA002 Snapshot-only test
  • WA003 Shallow assertion on complex return

Happy-path bias

  • HP001 No negative case in file
  • HP002 Boundary-free test coverage
  • HP003 Only success-path descriptions

Mocking risk

  • MR001 Interaction-only test
  • MR002 High mock density
  • MR003 Core dependency over-mocked

Notes On Behavior

  • The scan only analyzes the active file.
  • Findings are heuristic but deterministic.
  • The fixture files under fixtures/ are treated as the canonical examples for expected v0 rule behavior.
  • The rules are intentionally conservative to avoid noisy output on healthy tests such as fixtures/healthy.test.ts.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages