zudo-test-wisdom
GitHub repository

Type to search...

to open search from anywhere

Tools Quick Reference

Tool install/run commands, capability matrix, and Vitest/Playwright config snippets by testing level.

Tools by Testing Level

LevelToolsInstallRun Command
1vitestpnpm add -D vitestpnpm vitest run
1jestpnpm add -D jestpnpm jest
1vitest + Miniflare (backend/Workers)pnpm add -D vitest miniflarepnpm vitest run
1vitest + @cloudflare/vitest-pool-workers (in-worker/Workers)pnpm add -D vitest @cloudflare/vitest-pool-workerspnpm vitest run
2vitest + jsdompnpm add -D vitest jsdompnpm vitest run
2vitest + happy-dompnpm add -D vitest happy-dompnpm vitest run
2@testing-library/reactpnpm add -D @testing-library/react(used in tests)
2vitest browser mode (@vitest/browser + Playwright)pnpm add -D vitest @vitest/browser playwrightpnpm vitest run --project browser
3vitest (reading built files)pnpm add -D vitestpnpm build && pnpm vitest run --project build
3cheerio + fs/pathpnpm add -D cheerio(used in tests)
3 / 4link check + html-validate (site-integrity gates)pnpm add -D html-validatepnpm build && pnpm check:html && pnpm check:links
4Playwrightpnpm add -D @playwright/test then npx playwright install --with-depsnpx playwright test
4headless-browser(Claude Code skill)/headless-browser
5verify-ui(Claude Code skill)/verify-ui
5headless-browser(Claude Code skill)/headless-browser
5Playwright toHaveScreenshot() (visual regression baselines)pnpm add -D @playwright/testnpx playwright test --update-snapshots (baseline) / npx playwright test (verify)
6verify-ui-ai (final resort, not for CI)(Claude Code skill)/verify-ui-ai

Bare vitest starts watch mode and never exits -- use vitest run for one-shot/CI/agent runs. The @playwright/test package alone does not include browser binaries; playwright install --with-deps downloads them plus their OS-level dependencies.

Tool Capabilities Matrix

Capabilityvitestvitest+jsdomPlaywrightverify-uiheadless-browser
Pure function testingYesYes------
DOM structure--YesYes----
User events--YesYes----
CSS computed styles----YesYes--
Visual screenshots----YesYesYes
Console errors----Yes--Yes
Multi-page navigation----Yes--Yes
Build outputYes--------
Responsive viewports----YesYesYes

Vitest Configuration Quick Reference

Minimal unit test setup

// vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    include: ["src/**/*.test.ts"],
  },
});

Component test setup (jsdom)

// vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    environment: "jsdom",
    include: ["src/**/*.test.tsx"],
    setupFiles: ["./test-setup.ts"],
  },
});

Projects setup (multiple test types)

// vitest.config.ts
import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    projects: [
      {
        test: { name: "unit", include: ["src/**/*.test.ts"], environment: "node" },
      },
      {
        test: {
          name: "component",
          include: ["src/**/*.test.tsx"],
          environment: "jsdom",
        },
      },
      {
        test: {
          name: "build",
          include: ["tests/build/**/*.test.ts"],
          environment: "node",
        },
      },
    ],
  },
});

Playwright Configuration Quick Reference

Basic setup

// playwright.config.ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  testDir: "./e2e",
  use: {
    baseURL: "http://localhost:3000",
  },
  webServer: {
    command: "pnpm dev",
    port: 3000,
    reuseExistingServer: !process.env.CI,
  },
});

WebKit-only (for Tauri)

// playwright.config.ts
import { defineConfig, devices } from "@playwright/test";

export default defineConfig({
  projects: [
    { name: "webkit", use: { ...devices["Desktop Safari"] } },
  ],
});

Production build testing

// playwright.config.ts
import { defineConfig } from "@playwright/test";

export default defineConfig({
  webServer: {
    command: "pnpm build && pnpm preview",
    port: 4173,
    reuseExistingServer: !process.env.CI,
  },
});

Claude Code Skill Commands

CommandLevelPurpose
/headless-browser4, 5Take screenshots, check console errors, interact with pages
/verify-ui5Assert computed CSS values deterministically
/verify-ui-ai6AI-judged visual verdict when L4 is intractable AND L5 cannot reach the assertion -- never for CI
/test-wisdom--Get guidance on which testing level to use

See Also

Revision History

CreatedUpdated