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 login
if needed) - A
checkly.config.ts
orcheckly.config.js
configuration 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 | 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. |
--reporter, -r | A list of custom reporters for the test output. |
--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
A list of custom reporters for the test output. Options: Examples:
list|dot|ci|github|json
Usage:Terminal
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
You can provide custom dependencies in Playwright Check Suites because they don’t rely on a specific runtime.
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