npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@boolesai/tspec

v1.3.1

Published

Unified testing framework for test specification files (.tcase)

Readme

@boolesai/tspec

Core library for TSpec - a multi-protocol testing DSL designed for Developer + AI collaboration.

npm version License: MIT

Installation

npm install @boolesai/tspec

Features

  • Parser: Parse and validate .tcase test specification files
  • Runner: Execute test cases with HTTP protocol support
  • Assertion: Rich assertion engine with multiple validation types
  • Scheduler: Concurrent test execution with configurable parallelism

Quick Start

import { 
  parseTestCases, 
  validateTestCase,
  scheduler,
  executeTestCase 
} from '@boolesai/tspec';

// Validate a test file
const validation = validateTestCase('./tests/login.http.tcase');
if (!validation.valid) {
  console.error('Validation errors:', validation.errors);
}

// Parse test cases
const testCases = parseTestCases('./tests/login.http.tcase', {
  params: { username: 'testuser' },
  env: { API_HOST: 'api.example.com' }
});

// Execute a single test
const result = await executeTestCase(testCases[0]);
console.log(result.passed); // true/false
console.log(result.summary); // { total: 4, passed: 4, failed: 0, passRate: 100 }

// Execute multiple tests with concurrency
const scheduleResult = await scheduler.schedule(testCases, { concurrency: 5 });
console.log(scheduleResult.summary);

Module Exports

The package provides both unified and modular exports:

// Unified import
import { parseTestCases, executeTestCase, scheduler } from '@boolesai/tspec';

// Modular imports
import { parseTestCases, validateTestCase } from '@boolesai/tspec/parser';
import { executeTestCase, registry } from '@boolesai/tspec/runner';
import { runAssertions, extractVariables } from '@boolesai/tspec/assertion';
import { scheduler, TestScheduler } from '@boolesai/tspec/scheduler';

API Reference

Parser Module

| Function | Description | |----------|-------------| | validateTestCase(filePath) | Validate a .tcase file | | parseTestCases(filePath, options?) | Parse file into executable test cases | | parseTestCasesFromString(content, options?) | Parse YAML string content |

Runner Module

| Function | Description | |----------|-------------| | executeTestCase(testCase, options?) | Execute a single test case | | createRunner(protocol, options?) | Create a protocol-specific runner | | registry | Protocol executor registry |

Assertion Module

| Function | Description | |----------|-------------| | runAssertions(response, assertions) | Run all assertions against a response | | runAssertion(response, assertion) | Run a single assertion | | extractVariables(response, extractMap) | Extract variables from response | | getAssertionSummary(results) | Get summary of assertion results |

Scheduler Module

| Function | Description | |----------|-------------| | scheduler.schedule(testCases, options?) | Execute tests with concurrency | | scheduler.scheduleByType(testCases, options?) | Execute tests grouped by protocol |

Supported Protocols

| Protocol | Status | |----------|--------| | HTTP/HTTPS | Supported | | gRPC | Planned | | GraphQL | Planned | | WebSocket | Planned |

Assertion Types

| Type | Description | |------|-------------| | json_path | JSONPath expression validation with unified response access ($.status, $.header, $.body) | | string | Extract and coerce value to string before comparison | | number | Extract and coerce value to number before comparison | | regex | Extract value using regex capture groups | | xml_path | XPath expression validation for XML responses | | response_time | Response time threshold validation | | javascript | Custom JavaScript validation |

Build from Source

Prerequisites:

  • Node.js >= 18.0.0
  • npm >= 9.0.0
# Clone the repository
git clone https://github.com/boolesai/testing-spec.git
cd testing-spec/core

# Install dependencies
npm install

# Build the package
npm run build

# Generate TypeScript declarations
npm run types

# Build with types (recommended)
npm run package

Build Output

  • dist/ - Compiled JavaScript (ESM and CJS)
  • types/ - TypeScript type definitions

Development Mode

# Watch mode for development
npm run dev

Link for Local Development

# In the core directory
npm link

# In your project directory
npm link @boolesai/tspec

Documentation

For complete TSpec DSL documentation, see the docs directory.

Related

License

MIT