@tspec/core
v1.5.0
Published
Core testing framework functionality for TSpec
Maintainers
Readme
@tspec/core
Core testing framework functionality for TSpec
ℹ️ Important Note
Provides the foundational testing APIs including
describe(),test(), and the test runner engine.This package is designed to work as part of the TSpec ecosystem and Typically used together with @tspec/assert for assertions.
Installation
npm install --save-dev @tspec/core @tspec/assertFeatures
- Test organization with
describe(),test(),it() - Async testing support with promises and async/await
- Test file discovery and execution
- TypeScript-first design with full type safety
Usage
import { describe, test } from '@tspec/core';
import { expect } from '@tspec/assert';
describe('My Component', () => {
test('should work correctly', () => {
const result = myFunction();
expect(result).toBe('expected');
});
});Complete Testing Example
import { describe, test } from '@tspec/core';
import { expect } from '@tspec/assert';
describe('core Example', () => {
test('demonstrates core functionality', () => {
// Test organization and structure
const value = 'test';
expect(value).toBe('test');
});
});Related Packages
TSpec is designed as a cohesive framework. Here are the related packages:
- @tspec/assert - Assertion library for TSpec testing framework
- @tspec/cli - Command-line interface for running TSpec tests
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.
