Top 200 ReposEXPLORER
Browse agents, categories and pages
Back to results
Planned, not doneThe source describes an intention, not a finished result.

Add Vitest Coverage to a Dormant Node Backend

Overview

Have Claude Code read a long-untouched Node backend, record its conventions, add Vitest tests on a branch and change source code only for failures you agree are real.

Problem or Objective

More in Coding and Code Review

AI Agents and Models

Tools and Integrations

Tools
Claude Code · Vitest · Node.js
Prerequisites
Claude Code, Node and a copy of the repository. The Vitest README states that Vitest requires Vite >=v6.4.0 and Node >=v22.12.0. Check what your plan allows.

How It Works

Create a branch, install the project as it is and check that your Node and Vite versions meet what Vitest requires. Write down how to install, run and test the project in AGENTS.md or CLAUDE.md; the overview says Claude Code can read an existing AGENTS.md in place of a CLAUDE.md. Ask Claude Code to map the modules and propose which behaviour to cover first, and approve that plan. Let it add Vitest and write tests in small groups, running them as it goes. For each failure, have it say whether the test or the code appears wrong, with evidence. Approve source fixes one at a time, keep test and fix changes separate, and read the diff before you commit.

Implementation Workflow

Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.

  1. Choose the agentSet up Claude Code.
  2. Connect the toolsConnect the tools this workflow relies on: Claude Code, Vitest, Node.js.
  3. Check the prerequisitesClaude Code, Node and a copy of the repository. The Vitest README states that Vitest requires Vite >=v6.4.0 and Node >=v22.12.0. Check what your plan allows.
  4. Gather your detailsCollect what the prompt asks for: How long it has been idle, Project instructions file, Area to cover first.
  5. Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
  6. Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.

Practical Starter Prompt: Add Vitest tests to an old backend

Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].

Preview
This Node backend has not been touched for [How long it has been idle]. Read [Project instructions file] and the code without changing anything, then propose a test plan starting with [Area to cover first] and list version or dependency problems. Wait for my approval. Then add Vitest and write tests in small groups, running them each time. Do not change source code without asking: for each failure say whether the test or the code looks wrong. Never connect to production, commit or push without my approval.

Approve the plan, then approve each source fix and the final commit after reading the diff.

Expected Results and Benefits

This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.

This is a suggested workflow, not a reported outcome. The overview names writing tests for untested code among the work Claude Code handles, and the Vitest README describes the testing framework and its version requirement. Neither says anything about your backend or what coverage you will reach. Top 200 Repos did not run this.

Limitations and Considerations

An old project may have outdated or vulnerable packages and a Node version that the test tool no longer supports, so upgrade deliberately and separately. Tests written from existing code can lock in bugs: check expected values against what the software is meant to do. Point tests at fakes or a disposable database, never production services, and keep real credentials out of the test environment. Results depend on your setup and were not independently reproduced by Top 200 Repos.

GitHub Repositories

AI Agent Repository

Source code of the agent that does the work.

Tool Repository

A tool this workflow relies on.

Official Website

The official site of the main tool or project in this use case.

Visit Website (opens in a new tab)code.claude.com

Related Videos

About anthropics/claude-code

About anthropics/claude-code

Independent creators. Listing a video implies no endorsement, sponsorship or partnership.

Sources

  1. Overview - Claude Code Docs (opens in a new tab)

    Project documentation · code.claude.com · Undated · Source checked 2 Dec 2026, 13:21 UTC

    What this source supports
    • Claude Code handles the tedious tasks that eat up your day: writing tests for untested code, fixing lint errors across a project, resolving merge conflicts, updating dependencies, and writing release notes.
    • If your repository already has an AGENTS.md for other coding agents, Claude Code can read that in place of a CLAUDE.md.
    • Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.
  2. vitest-dev/vitest README (opens in a new tab)

    Project documentation · github.com · Undated · Source checked 2 Dec 2026, 13:21 UTC

    What this source supports
    • Next generation testing framework powered by Vite.
    • Vitest requires Vite >=v6.4.0 and Node >=v22.12.0
Report a problem

More with Claude Code

Planned, not done

Create Custom Store Tools Instead of Paying for Subscriptions

Use Claude Code to write small in-house tools for an online shop, such as a reply helper for support mail or a margin report, as an alternative to paying for separate apps, with testing before you rely on them.

code.claude.comanthropics/claude-code
Reported by source

Answer technical questions by letting async agents run experiments

Simon Willison sends research questions to cloud coding agents such as Claude Code for web and Codex Cloud, which write and run experiments in a dedicated repo and open a PR.

simonwillison.net · 6 Nov 2025anthropics/claude-code, openai/codex
Planned, not done

Structure Repeated Browser Research Into Evidence Tables

Give Claude Code the open-source Browser Use CLI with a local browser, ask the same research questions across a short list of pages, and keep every answer as a sourced table row.

github.comanthropics/claude-code, browser-use/browser-use

View all: Claude Code