Test Command
Run tests for Eliza agent projects and plugins.
- Overview & Options
- Examples & Guides
Usage
elizaos test [options] [command]
Subcommands
Subcommand | Description |
---|---|
component | Run component tests (via Vitest) |
e2e | Run end-to-end runtime tests |
all | Run both component and e2e tests (default) |
Options
Option | Description |
---|---|
-p, --port <port> | Server port for e2e tests |
-n, --name <n> | Filter tests by name (matches file names or test suite names) |
--skip-build | Skip building before running tests |
--skip-type-check | Skip TypeScript type checking for faster test runs |
--watch | Enable watch mode to re-run tests on file changes |
--coverage | Generate a test coverage report |
Examples
Basic Test Execution
# Run all tests (component and e2e) - default behavior
elizaos test
# Explicitly run all tests
elizaos test all
# Run only component tests
elizaos test component
# Run only end-to-end tests
elizaos test e2e
Test Filtering
# Filter component tests by name
elizaos test component --name auth
# Filter e2e tests by name
elizaos test e2e --name database
# Filter all tests by name
elizaos test --name plugin
Advanced Options
# Run tests on custom port for e2e
elizaos test e2e --port 4000
# Skip building before running tests
elizaos test --skip-build
# Generate a test coverage report
elizaos test --coverage
# Run tests in watch mode for continuous development
elizaos test --watch
# Combine options
elizaos test e2e --port 3001 --name integration --skip-build
Test Types
Component Tests
Location: __tests__/
directory
Framework: Vitest
Purpose: Unit and integration testing of individual components
End-to-End Tests
Location: e2e/
directory
Framework: Custom ElizaOS test runner
Purpose: Runtime behavior testing with full agent context