CLI Configuration Documentation

June 15, 2026 · View on GitHub

This document provides comprehensive information about all CLI options and environment variables available in the check-tests tool.

Usage

npx check-tests <framework> <files> [options]

Required Arguments

  • <framework> - Test framework to analyze (codeceptjs, jasmine, jest, mocha, newman, playwright, qunit, testcafe, nightwatch)
  • <files> - Glob pattern to match test files (e.g., "tests/**/*_test.js")

Push Command

The push command is a shortcut for importing markdown-based manual tests into Testomat.io. It is equivalent to check-tests manual <files> with --update-ids enabled by default.

npx check-tests push [options]

Push Options

OptionDescriptionDefault
-d, --dir <dir>Test directory to scanCurrent dir
-f, --files <files...>One or more file paths or glob patterns to push**/*.test.md
--forceSkip git checks and force push filesfalse

The push command also accepts the same Testomat.io and analysis options as the main command (--sync, --create, --no-empty, --keep-structure, --clean-ids, --purge, --no-detached, --no-skipped, --exclude, etc.).

--files Option

Use --files (or -f) to override the default glob (**/*.test.md). It accepts:

  • a single file path — push exactly that file
  • multiple file paths — push every listed file
  • a glob pattern (in quotes) — push every file matched by the pattern
  • multiple glob patterns — push the union of files matched by each pattern

Paths and patterns are resolved relative to --dir (or the current directory if --dir is not set).

Push Examples

# Push every **/*.test.md file under the current directory (default behaviour)
TESTOMATIO=your-api-key npx check-tests push

# Push a single markdown file
TESTOMATIO=your-api-key npx check-tests push --files docs/login.test.md

# Push several specific files
TESTOMATIO=your-api-key npx check-tests push -f docs/login.test.md docs/checkout.test.md

# Push everything matching a custom glob (quote the pattern!)
TESTOMATIO=your-api-key npx check-tests push --files "manual-tests/**/*.md"

# Combine multiple globs (e.g. smoke + regression suites)
TESTOMATIO=your-api-key npx check-tests push -f "smoke/**/*.test.md" "regression/**/*.test.md"

# Use a non-default directory together with --files
TESTOMATIO=your-api-key npx check-tests push -d ./tests --files "**/*.md"

CLI Options

Basic Options

OptionDescriptionDefault
-d, --dir <dir>Test directory to scanCurrent directory
--typescriptEnable TypeScript supportfalse
--exclude <pattern>Glob pattern to exclude files from analysis-

Testomat.io Integration

OptionDescriptionDefault
--syncImport tests to Testomat.io and wait for completionfalse
--no-detachedDon't mark all unmatched tests as detachedfalse
--update-idsUpdate test and suite with Testomat.io IDsfalse
--createCreate tests and suites for missing IDsfalse
--keep-structurePrefer structure of source code over structure in Testomat.iofalse
--no-emptyRemove empty suites after importfalse
--clean-idsRemove Testomat.io IDs from test and suitefalse
--purge, --unsafe-clean-idsRemove Testomat.io IDs without server verificationfalse
--partialImport only tests from -d directory into the matching folder, without marking tests outside it as detached (requires -d; equivalent to -d <dir> + TESTOMATIO_PREPEND_DIR=<dir>)false

Test Analysis Options

OptionDescriptionDefault
--no-skippedThrow error if skipped tests are foundfalse
--no-hooksExclude test hooks code from the code on the clientfalse
--line-numbersAdd line numbers to each block of codefalse
--test-alias <test-alias>Specify custom alias for test/it functions (comma-separated)-
--require-idsFail build if tests are missing Testomat.io IDsfalse
--forceSkip git checks and force push filesfalse

Export Options

OptionDescriptionDefault
-g, --generate-file <fileName>Export test details to a document-
-u, --url <url>GitHub URL to get files (URL/tree/master)-

Advanced Options

OptionDescriptionDefault
-p, --plugins [plugins...]Additional Babel plugins-

Environment Variables

Testomat.io Configuration

VariableDescriptionRequired
TESTOMATIOAPI key for Testomat.ioYes (for sync operations)
TESTOMATIO_URLTestomat.io server URLNo (default: https://app.testomat.io)
TESTOMATIO_BRANCHBranch name for Testomat.ioNo
TESTOMATIO_WORKDIRWorking directory for relative file pathsNo
TESTOMATIO_PREPEND_DIRDirectory to prepend to test pathsNo
TESTOMATIO_SUITESuite name for testsNo
TESTOMATIO_LABELSComma-separated labels to apply to all tests. Supports label:value format for label valuesNo
TESTOMATIO_SYNC_LABELSAlias for TESTOMATIO_LABELS (compatibility)No
TESTOMATIO_NO_DETACHEDDon't mark unmatched tests as detachedNo

Examples

Basic Usage

# Analyze Jest tests
npx check-tests jest "tests/**/*.test.js"

# Analyze Playwright tests with TypeScript
npx check-tests playwright "tests/**/*.spec.ts" --typescript

# Exclude node_modules from analysis
npx check-tests mocha "**/*.test.js" --exclude "**/node_modules/**"

Testomat.io Integration

# Sync tests with Testomat.io
TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js" --sync

# Update test IDs
TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js" --update-ids

# Create missing tests and suites
TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js" --create

# Import tests into a specific suite
TESTOMATIO_SUITE=S1234567 TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js"

# Import tests with custom working directory
TESTOMATIO_WORKDIR=./e2e TESTOMATIO=your-api-key npx check-tests playwright "**/*.spec.ts"

# Import tests into a specific folder
TESTOMATIO_PREPEND_DIR="Frontend Tests" TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js"

# Apply labels to all imported tests
TESTOMATIO_LABELS="smoke,regression" TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js"

# Apply labels with values using label:value format
TESTOMATIO_LABELS="severity:high,feature:auth,team:frontend" TESTOMATIO=your-api-key npx check-tests jest "tests/**/*.test.js"

# Mix simple labels and label:value pairs
TESTOMATIO_LABELS="smoke,severity:critical,regression" TESTOMATIO=your-api-key npx check-tests playwright "tests/**/*.spec.ts"

# Apply labels using the alias (for Python SDK compatibility)
TESTOMATIO_SYNC_LABELS="api,integration" TESTOMATIO=your-api-key npx check-tests playwright "tests/**/*.spec.ts"

Export Options

# Generate test documentation
npx check-tests jest "tests/**/*.test.js" --generate-file tests.md

# Analyze tests from GitHub repository
npx check-tests jest "tests/**/*.test.js" --url https://github.com/user/repo/tree/main

Configuration Files

The tool supports loading environment variables from .env files using dotenv. Create a .env file in your project root:

TESTOMATIO=your-api-key
TESTOMATIO_URL=https://app.testomat.io
TESTOMATIO_BRANCH=main

Exit Codes

  • 0 - Success
  • 1 - Error (general)
  • 2 - Skipped tests found (when --no-skipped is used)
  • 1 - Tests missing Testomat.io IDs found (when --require-ids is used)

Supported Frameworks

  • CodeceptJS - JavaScript/TypeScript BDD testing framework
  • Jasmine - Behavior-driven development framework
  • Jest - JavaScript testing framework
  • Mocha - JavaScript test framework
  • Newman - Postman collection runner
  • Playwright - Web testing and automation framework
  • QUnit - JavaScript unit testing framework
  • TestCafe - Web testing framework
  • Nightwatch - End-to-end testing framework