CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-testem

Test-framework agnostic JavaScript testing runner that supports TDD workflows and CI integration across multiple browsers and environments.

Pending
Overview
Eval results
Files

cli.mddocs/

Command Line Interface

Testem provides a comprehensive command line interface for running tests in development and CI environments.

Capabilities

Development Mode

Interactive development mode with file watching and real-time test execution.

testem [options]

# Options:
# -f, --file [file]         Configuration file (testem.json, testem.yml)  
# -p, --port [num]          Server port (default: 7357)
# --host [hostname]         Host name (default: localhost)
# -l, --launch [list]       Comma-separated list of launchers to launch
# -s, --skip [list]         Comma-separated list of launchers to skip
# -d, --debug [file]        Output debug to log file (default: testem.log)
# -t, --test_page [page]    Custom HTML test page
# -g, --growl               Enable growl/native notifications

Usage Examples:

# Basic development mode
testem

# With custom configuration
testem -f my-config.json

# Specific browsers
testem -l Chrome,Firefox

# Custom port and debug logging
testem -p 8080 -d debug.log

# Skip specific launchers
testem -s IE,Safari

Interactive Controls:

  • ENTER - Run the tests
  • q - Quit
  • / - Move between browser tabs
  • TAB - Switch between top/bottom panels
  • / - Scroll up/down in text panel
  • SPACE - Page down
  • b - Page up
  • d - Half page down
  • u - Half page up

CI Mode

Continuous integration mode for automated test execution.

testem ci [options]

# Additional CI options:
# -T, --timeout [sec]       Browser timeout in seconds
# -P, --parallel [num]      Number of parallel browsers (default: 1)
# -b, --bail_on_uncaught_error  Exit on uncaught errors
# -R, --reporter [reporter] Test reporter (tap|dot|xunit|teamcity)

Usage Examples:

# Basic CI mode
testem ci

# Parallel execution
testem ci -P 5

# Custom reporter
testem ci -R xunit

# With timeout and bail on error
testem ci -T 60 -b

# Combined options
testem ci -P 3 -R tap -T 30

Server Mode

Server-only mode for manual testing without automatic browser launching.

testem server [options]

# Uses same options as development mode but doesn't auto-launch browsers

Usage Examples:

# Start server only
testem server

# Custom port
testem server -p 9000

# With configuration file
testem server -f server-config.json

Launchers Command

List available browser and process launchers on the system.

testem launchers

Example Output:

Have 7 launchers available; auto-launch info displayed on the right.

Launcher      Type          CI  Dev
------------  ------------  --  ---
Chrome        browser       ✔   
Firefox       browser       ✔   
Safari        browser       ✔   
IE            browser       ✔   
Node          process       ✔   
PhantomJS     browser       ✔   
Mocha         process(TAP)  ✔

Help Commands

Get help information for testem commands.

testem --help          # General help
testem ci --help       # CI mode help

Global Options

Options available across all testem commands:

# Configuration
-f, --file [file]         # Configuration file path
-p, --port [num]          # Server port number
--host [hostname]         # Server hostname

# Browser Control  
-l, --launch [list]       # Launchers to start (comma-separated)
-s, --skip [list]         # Launchers to skip (comma-separated)

# Output & Debugging
-d, --debug [file]        # Debug output file
-g, --growl               # Native notifications
-t, --test_page [page]    # Custom test page

# CI-Specific
-T, --timeout [sec]       # Browser timeout
-P, --parallel [num]      # Parallel browsers
-b, --bail_on_uncaught_error  # Exit on errors
-R, --reporter [reporter] # Test reporter format

Exit Codes

Testem uses standard exit codes to indicate test results:

0  # All tests passed
1  # Tests failed or error occurred

Environment Variables

Environment variables that affect testem behavior:

PORT                      # Default port (overridden by --port)
TESTEM_CONFIG            # Configuration file path
NODE_ENV                 # Environment mode (affects default settings)

Configuration File Discovery

Testem automatically searches for configuration files in this order:

testem.json              # JSON configuration (highest priority)
.testem.json            # Hidden JSON configuration
.testem.yml             # Hidden YAML configuration  
testem.yml              # YAML configuration
testem.js               # JavaScript configuration
.testem.js              # Hidden JavaScript configuration
testem.cjs              # CommonJS configuration
.testem.cjs             # Hidden CommonJS configuration (lowest priority)

If multiple files exist, testem uses the first one found and warns about duplicates.

Install with Tessl CLI

npx tessl i tessl/npm-testem

docs

cli.md

configuration.md

index.md

launchers.md

programmatic-api.md

reporters.md

tile.json