@tspec/cli
v1.5.0
Published
Command-line interface for running TSpec tests
Maintainers
Readme
@tspec/cli
Command-line interface for running TSpec tests
ℹ️ Important Note
Provides the
tspeccommand for discovering and running your test files.The CLI automatically includes @tspec/core as a dependency. For full functionality, you'll also want @tspec/assert for assertions.
Installation
npm install --save-dev @tspec/cliFeatures
- Zero-config test runner with intelligent defaults
- Automatic TypeScript compilation with tsx
- Flexible CLI options for different workflows
- CI/CD integration with proper exit codes
Usage
# Run all tests
npx tspec
# Run with verbose output
npx tspec --verbose
# Run specific test files
npx tspec tests/unit.tspec.ts
# Global installation
npm install -g @tspec/cli
tspecComplete Testing Example
First, create a test file example.tspec.ts:
import { describe, test } from '@tspec/core';
import { expect } from '@tspec/assert';
describe('Math Operations', () => {
test('addition works correctly', () => {
expect(2 + 2).toBe(4);
});
});Then run with the CLI:
npx tspec example.tspec.tsRelated Packages
TSpec is designed as a cohesive framework. Here are the related packages:
- @tspec/core - Core testing framework functionality for TSpec
- @tspec/assert - Assertion library for TSpec testing framework
- @tspec/mock - Mocking and spying utilities for TSpec testing framework
Documentation & Support
- 📖 Complete Documentation - Full usage guide and API reference
- 🚀 Getting Started Guide - Step-by-step setup
- 💡 Examples - Real-world usage examples
- 🐛 Issues - Report bugs or request features
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
- Setting up the development environment
- Running tests and ensuring quality
- Submitting pull requests
License
MIT License - see the LICENSE file for details.
