Command Line Interface

This part is the user's entry point. It reads the command typed in the terminal, interprets the options, and starts the main test controller.

Columns are parts of the code, grouped by process. Read top to bottom. Solid arrow: hands work over. Dashed: the reply. Purple: crosses between processes. Hook: work inside one part. Dashed boxes repeat. Hover a column name or a step for its full text.

MAIN PROCESSProcess each CLI optionServer callbacks run in parallelParse each filename filterCreate and parse CLIReturn configured CLIReturn configured CLITransform nested booleanApply nested transformTransform option valueApply value transformTransform next valueApply next transformTransform optionApply option transformTransform remainingApply final transformApply watermark transformProcess watermarkResolve run modePass mode and filtersInitialize contextSet up serverRun callbacks in parallelExecute server call…Map environment nameDiscover specificationsParse filename filterPar…Group filters by fileCol…Start test execution
CLI Entry
Command Setup
Option Config
API Starter
Filter Logic
1Parse command line arguments — The command line entry point creates the interface for the test tool and immediately parses the arguments provided by the user. This happens once when the module loads, capturing everything typed after the command name. The parsed arguments are passed along for further processing.
2Configure commands and options — The command definitions set up the available commands like run, watch, and bench, along with all their configurable options. It configures help text, version information, and how options appear to the user. The system prepares to register each enabled option.
3Transform nested boolean option — The option configuration processes a nested boolean value, converting it to the correct format for internal use. This handles options that have child settings or depend on other flags. The transformed value returns to continue registration.
4Transform option value — The option configuration transforms another option value, applying normalization rules to ensure consistency. This step handles format conversion and validation of the raw input. The processed value is handed back.
5Transform next option value — The option configuration continues transforming option values, applying the same normalization rules. Each option goes through this transformation to ensure proper formatting. The result returns to the caller.
6Transform another option value — The option configuration processes yet another option value through its transformation pipeline. This ensures all raw string inputs become proper configuration values. The transformed result passes back.
7Transform remaining option — The option configuration handles the final standard option transformation. This completes the bulk of option processing before special handling occurs. The value returns for registration.
8Apply watermark transform — The option configuration applies a special watermark transformation to handle specific marking or identification needs. This transformation ensures certain options are properly tagged or identified. The result goes back to the definitions.
9Start test mode execution — The command definitions resolve whether to run tests once or watch for changes, based on the provided options. It determines the mode and prepares the filters and options for the test runner. Everything needed to start testing is gathered.
10Initialize test runner context — The API starter creates the main test context and ensures the required environment packages are available. It sets environment variables for test mode and resolves the root directory from options or the current working directory. The context is now ready for the server.
11Set up development server — The command line entry reinitializes the test tool around a development server, clearing any previous state and preparing for a fresh run. It resolves the configuration, creates the state tracking, and initializes reporters for output. The server setup completes with callbacks registered.
12Execute server callbacks — The API starter executes the callbacks that were registered after the server was set up, running in parallel with other initialization. This handles any additional setup needed now that the server is ready. The callbacks complete their work.
13Discover test specifications — The command line entry discovers test specifications across all projects, searching for test files and validating any location filters provided. It prepares to parse filename filters that may include specific line numbers. Each filter needs individual parsing.
14Group filters by filename — The filter parsing groups all parsed filters by their filename and collects any defined line numbers for each file. It keeps duplicates and maintains the order from the input, with file-only filters yielding empty line arrays. The grouped filters are ready for test execution.
STEP · hover for full text