Create a new TestRunner instance
The current working directory URL
Test runner configuration options
The script file to run as a child process
The current working directory URL
Test runner configuration options including filters, reporters, and hooks
CLI UI instance to log colorful messages and progress information
CLI UI instance to log colorful messages and progress information
Add listener to get notified when test runner is closed
Function to call when test runner closes
This TestRunner instance for method chaining
Add listener to get notified when test runner encounters an error
Function to call when test runner encounters an error
This TestRunner instance for method chaining
Close watchers and running child processes
Cleans up file system watchers and terminates any running test processes to ensure graceful shutdown.
Runs tests once without watching for file changes
Executes the test suite a single time and exits. This is the equivalent of running tests in CI/CD environments.
Run tests in watch mode and re-run them when files change
Starts the test runner in watch mode, monitoring the file system for changes and automatically re-running tests when relevant files are modified. Uses intelligent filtering to run only affected tests when possible.
TypeScript module reference for parsing configuration
Optionaloptions: { poll: boolean }Watch options including polling mode for file system monitoring
Exposes the API to run Japa tests and optionally watch for file changes to re-run the tests.
The TestRunner provides intelligent test execution with watch mode capabilities. When files change, it can selectively run specific tests or the entire suite based on what changed.
The watch mode functions as follows:
node ace testcommand.Example
Example