@tspec/core
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

@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.

📖 View complete documentation and examples →

Installation

npm install --save-dev @tspec/core @tspec/assert

Features

  • 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

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.


Package Sidebar

Install

npm i @tspec/core

Weekly Downloads

20

Version

1.5.0

License

MIT

Unpacked Size

60.3 kB

Total Files

30

Last publish

Collaborators

  • rchmn333