Usage
Subcommands
run
Discover and run tests with optional filtering, gas reporting, and coverage.Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--suite | string | — | Run a specific suite by name |
--filter | string | — | Filter tests by name substring |
--parallel | int | 4 | Maximum parallel test count |
--gas-report | bool | false | Generate gas usage report |
--coverage | bool | false | Generate coverage report |
--snapshot | bool | false | Enable snapshot isolation per test |
--timeout | duration | — | Per-test timeout (e.g., 30s, 2m) |
--json | bool | false | Output results as JSON |
Test File Discovery
Dokrypt automatically discovers tests based on file patterns:| Language | Patterns | Runner |
|---|---|---|
| Solidity | *.t.sol, *.test.sol, *_test.sol | forge test |
| JavaScript | *.test.js, *.js | node or npx hardhat test |
| TypeScript | *.test.ts, *.ts | npx hardhat test |
test/, tests/, contracts/test/, or as configured in dokrypt.yaml.
Configuration via dokrypt.yaml
Test settings can also be configured indokrypt.yaml:
Built-in Validation Suite
If no test files are found, Dokrypt runs a built-in validation suite:| Test | Description |
|---|---|
chain_is_running | Basic connectivity check |
accounts_available | At least one account exists |
chain_id_valid | Chain ID is non-zero |
mining_works | Can mine blocks successfully |
snapshot_restore | Snapshot and revert work correctly |
Examples
Example Output
~/.dokrypt/reports/<project>/latest.json.
list
List all discovered test suites.Example Output
report
Show the results from the last test run.~/.dokrypt/reports/<project>/latest.json and displays the results, including gas report if available.