TESTING.md
This document provides an overview of the testing infrastructure in Lerna-Lite.
Lerna-lite uses a two-tier testing approach:
packages/*/src/**/__tests__/*.spec.ts) - Fast, isolated tests for individual functions and classese2e/**/*.spec.ts) - Complete CLI workflow tests that verify the actual user experienceThis follows Lerna's recommendation to prefer E2E tests over integration tests for CLI tools, as they provide the highest value by testing what users actually interact with.
# Run all unit tests
pnpm test
# Watch mode
pnpm test:watch
# Run e2e tests (builds first, starts Verdaccio automatically)
pnpm test:e2e
# Or run in watch mode (assumes you've built already)
pnpm test:e2e:watch
See e2e/README.md for comprehensive e2e testing documentation.
packages/*/src/**/__tests__/*.spec.ts # Unit tests (co-located with source)
e2e/ # E2E tests
e2e-utils/ # E2E testing utilities
{
"test": "vitest run",
"test:watch": "vitest watch",
"test:e2e": "node scripts/run-e2e-with-verdaccio.mjs",
"test:e2e:watch": "vitest watch --config ./e2e/vitest.config.ts"
}