testify-universal-cli
Version:
Universal interactive CLI tool for scanning and executing tests across multiple programming languages
173 lines (127 loc) • 5.29 kB
Markdown
# Testify Universal CLI
```
_______ _ _ __
|__ __| | | (_)/ _|
| | ___ ___| |_ _| |_ _ _
| |/ _ \/ __| __| | _| | | |
| | __/\__ \ |_| | | | |_| |
|_|\___||___/\__|_|_| \__, |
__/ |
|___/
```
[](https://www.npmjs.com/package/testify-universal-cli)
[](https://opensource.org/licenses/MIT)
Testify Universal CLI is a language-agnostic interactive command-line tool for running tests across multiple programming languages and frameworks. It automatically detects your project's language, finds test files, extracts test markers/tags, and provides an intuitive interface for filtering and running tests.
## Features
- **Multi-language support**: Detects and runs tests for Node.js, Python, Ruby, Go, Java, and Rust projects
- **Framework-agnostic**: Works with popular testing frameworks like Jest, Vitest, pytest, RSpec, and more
- **Interactive interface**: Select and filter tests through an easy-to-use CLI interface
- **Test markers/tags**: Filter tests based on markers, tags, or categories
- **React/NextJS support**: Full support for React components with JSX/TSX test files
- **Global availability**: Available worldwide through NPM with Cloudflare CDN distribution
## Installation
```bash
# Install globally using npm
npm install -g testify-universal-cli
# Or use with npx
npx testify-universal-cli
```
## Usage
```bash
# Run in the current directory
testify
# Filter tests by markers/tags
testify --marker=integration
testify --marker=fast --marker=api
# Force a specific language
testify --language=ruby
# Use a custom test runner
testify --runner=jest
# Run in a different directory
testify --cwd=./my-project
```
## Interactive Interface
Testify provides an intuitive, interactive command-line interface:
```
TESTIFY Test Selection
No active filters. Select markers below to filter tests.
? Select an action:
Run All Tests
── Filter By Marker ──
api
auth
benchmark
❯ error
fast
get
integration
performance
post
slow
── Test Files ──
tests/test_api.py [api, get, post, auth, error]
tests/test_hello.py
tests/test_markers.py [fast, slow, api, integration]
tests/test_performance.py [performance, fast, slow, benchmark]
```
Use arrow keys to navigate, Enter to select markers or files, and get a smooth testing experience across any programming language.
## Supported Languages and Test Frameworks
| Language | Test Frameworks |
|----------|-----------------------------|
| Node.js | Jest, Vitest, Mocha, React Testing Library |
| Python | pytest |
| Ruby | RSpec, Rake Test |
| Go | go test |
| Java | JUnit with Maven/Gradle |
| Rust | Cargo Test |
## Deployment Guide
### Publishing to NPM
To publish the package to the NPM registry:
```bash
# Update version
npm version patch|minor|major
# Set registry to NPM
npm config set registry https://registry.npmjs.org/
# Publish package
npm publish
```
### Deploying to Cloudflare CDN
The package is automatically distributed via Cloudflare CDN when published to NPM. Configuration is stored in `.cdn-config.json`.
### Automated Deployment
The repository includes a deployment script that automates the entire process:
```bash
# Run the deployment script
./scripts/deploy.sh
```
The script will:
1. Validate your git state and branch
2. Bump the package version
3. Deploy to your private registry if configured
4. Publish to the public NPM registry
5. Push changes to the repository
6. Deploy to Cloudflare if wrangler is available
## Cross-Platform Compatibility
Testify is designed to work seamlessly across operating systems:
- **Windows**: Full support for Command Prompt and PowerShell with Windows-specific path handling, executable detection, and terminal features
- **macOS/Linux**: Works natively with Unix-style terminals and paths
- **Local Development**: Adapts to different development environments and setups
Special considerations are made for:
- Path separators and case sensitivity differences
- Command availability and executable extensions (.exe, .cmd, .bat)
- Terminal features and capabilities
- Python environments (handles both 'python' and 'py' commands on Windows)
## React and Next.js Support
Testify Universal CLI provides specialized support for React and Next.js projects:
- Automatic detection of React projects by finding JSX/TSX files
- Support for Jest with React Testing Library
- Proper environment configuration for DOM testing
- Automatic component test discovery for Next.js projects
Example of running tests in a Next.js project:
```bash
testify --cwd=./my-nextjs-app
```
## Why Testify?
- **Universal testing experience**: No need to learn different test commands for each language
- **Consistent interface**: Same CLI experience regardless of the underlying test framework
- **Interactive filtering**: Easily select and run specific tests based on markers/tags
- **Low friction**: Works out of the box with minimal configuration