checkly test command executes all checks in your project on the Checkly cloud infrastructure. This command provides a dry-run capability for testing your monitoring setup before deployment, with support for different environments and configurations.
Prerequisites
Prerequisites
Before using , ensure you have:
- An initialized Checkly CLI project
- At least one check or resource defined in your project
- Valid Checkly account authentication (run
npx checkly loginif needed) - A
checkly.config.tsorcheckly.config.jsconfiguration file
Basic Usage
The basic command runs all checks in your project as a test run without deploying them to your account as monitors.Terminal
| Option | Required | Description |
|---|---|---|
--config, -c | - | The Checkly CLI configuration file. If not passed, uses the checkly.config.ts|js file in the current directory. |
--env, -e | - | Env vars to be passed to the test run. Can be used multiple times. |
--env-file | - | dotenv file path to be passed. For example --env-file="./.env" |
--grep, -g | - | Only run checks where the check name matches a regular expression. Default: .* |
--list | - | List all checks but don’t run them. |
--location, -l | - | The location to run the checks at. |
--private-location | - | The private location to run checks at. |
--record | - | Record test results in Checkly as a test session with full logs, traces and videos. |
--refresh-cache | - | Force a fresh install of dependencies and update the cached version. |
--reporter, -r | - | One or more custom reporters for the test output. Supports comma-separated values and repeated flags. |
--retries | - | How many times to retry a failing test run. |
--tags, -t | - | Filter the checks to be run using a comma separated list of tags. |
--test-session-name, -n | - | A name to use when storing results in Checkly with --record. |
--timeout | - | A timeout (in seconds) to wait for checks to complete. |
--update-snapshots, -u | - | Update any snapshots using the actual result of this test run. |
--verbose, -v | - | Always show the full logs of the checks. |
--[no-]verify-runtime-dependencies | - | Return an error if checks import dependencies that are not supported by the selected runtime. |
Command Options
The Checkly CLI configuration file. If not passed, uses the
checkly.config.ts|js file in the current directory.Usage:Terminal
Environment variables to be passed to the test run. Can be used multiple times.Usage:Examples:
Terminal
Terminal
Path to a dotenv file containing environment variables.Usage:
Terminal
Only run checks where the check name matches a regular expression. Default:
.*Usage:Terminal
The location to run the checks at.Usage:
Terminal
The private location to run checks at.Usage:Examples:
Terminal
Terminal
Filter the checks to be run using a comma separated list of tags. Checks will only be run if they contain all of the specified tags. Multiple Examples:
--tags flags can be passed, in which case checks will be run if they match any of the --tags filters.Usage:Terminal
Terminal
List all checks to be run but don’t run them.Usage:
Terminal
One or more custom reporters for the test output. Options: Examples:
list, dot, ci, github, json.You can combine multiple reporters by passing multiple --reporter flags or using a comma-separated list. When no --reporter flag is provided, the CLI falls back to the cli.reporters array in checkly.config.ts, then defaults to list (or ci in CI environments).Usage:Terminal
Terminal
Force a fresh install of dependencies and update the cached version. Use this when you’ve changed your project’s dependencies and need Checkly to pick up the latest versions instead of using the cache from a previous run.Usage:
Terminal
How many times to retry a failing test run. Default: 0, max: 3Usage:Examples:
Terminal
Terminal
A name to use when storing results in Checkly with
--record.Usage:Terminal
A timeout (in seconds) to wait for checks to complete.Usage:
Terminal
Update any snapshots using the actual result of this test run.Usage:
Terminal
Snapshots are essential for visual regression testing in Browser Checks.
Always show the full logs of the checks.Usage:
Terminal
Return an error if checks import dependencies that are not supported by the selected runtime. Default: trueUsage:Runtime-dependent checks run in a specific runtime with a pre-defined set of dependencies. If you’re using private locations and want to provide your own dependencies, disable the built-in dependency validation.
Terminal
Examples
Dry run all your project checks and monitors:Terminal
product and api in the file name:
Terminal
Terminal
Terminal
process.env:
Terminal
Related Commands
checkly pw-test- Run Playwright tests in the Checkly cloudcheckly trigger- Run deployed checks on-demandcheckly deploy- Deploy your application