TESTING-SPEC

A multi-protocol testing DSL designed for Developer + AI collaboration

What is TSpec?

TSpec (Test Specification) is a YAML-based domain-specific language for defining API test cases. Designed for both AI-assisted test generation and developer maintainability.

AI Native

Designed from the ground up for AI-assisted test generation with structured metadata and clear context

Comprehensive Assertions

Rich assertion types including JSON path, regex, JavaScript, and response time validation

Template Inheritance

Reuse test configurations across multiple test cases

Data-Driven Testing

Parameterized testing with multiple data sources (CSV, JSON, YAML)

Variable System

Built-in functions and dynamic variable substitution

Lifecycle Hooks

Setup and teardown for test isolation and state management

Installation

Core Library

npm install @boolesai/tspec

CLI Tool

npm install -g @boolesai/tspec-cli
VSCode Extension Syntax highlighting, IntelliSense, and test runner integration

Example

A complete test specification in a single, readable YAML file.

login_success.http.tspec
version: "1.0"
description: "Verify successful login"

metadata:
  prompt: |
    Test that a user with valid credentials
    can successfully login and receive a JWT token.
  tags: ["auth", "login", "smoke"]

http:
  method: "POST"
  path: "/v1/auth/login"
  headers:
    Content-Type: "application/json"
  body:
    json:
      username: "${username}"
      password: "${env.PASSWORD}"

assertions:
  - type: "json_path"
    expression: "$.status"
    expected: 200
  - type: "json_path"
    expression: "$.data.token"
    operator: "exists"