MediumTesting

No Test Files in the Repo

The repo contains no test files (Vitest, Jest, Playwright, or equivalent), so regressions ship undetected and refactoring is a guess every time.

Typical error

Project has zero test files

What this is

72% of AI-built apps we scanned contain zero test files. The generated code works the first time, so the AI never bothers with tests. Every subsequent change is a blind edit.

Why AI tools ship this

Tests feel like extra work. The generated app passes by running it, not by asserting its behavior. AI tools default to the minimum path and stop there.

How to detect

find . -type f \( -name "*.test.ts" -o -name "*.test.tsx" -o -name "*.spec.ts" -o -name "*.spec.tsx" \) ! -path "./node_modules/*" ! -path "./.next/*" | head

Empty output means you have no tests.

How to fix

Start with a minimum viable test strategy. You do not need 100% coverage. You need tests for the paths that, if broken, would embarrass you.

  1. Install Vitest:

    npm install -D vitest @testing-library/react @testing-library/jest-dom jsdom
  2. Add a smoke test that loads the home page:

    // app/__tests__/home.test.tsx
    import { describe, expect, it } from 'vitest'
    import { render, screen } from '@testing-library/react'
    import Home from '../page'
     
    describe('home page', () => {
      it('renders the hero heading', () => {
        render(<Home />)
        expect(screen.getByRole('heading', { level: 1 })).toBeInTheDocument()
      })
    })
  3. Add an integration test for your most critical flow (checkout, auth, core user action).

  4. Run in CI so regressions cannot merge.

Having 5 tests that cover the critical paths beats 0 tests every time.

Commonly affected tools

Is your app affected?

FinishKit checks for this finding and 50+ more across 8 dimensions of production readiness. Free during beta.

Scan your app