fix(docs): refresh documentation and test timing tolerances for updated APIs

This commit is contained in:
2026-05-09 12:36:02 +00:00
parent 6d6a08b168
commit 6c8485c779
11 changed files with 2093 additions and 3106 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog
## 2026-05-09 - 3.6.6 - fix(docs)
refresh documentation and test timing tolerances for updated APIs
- update README content to reflect current runtime execution order, CLI options, Deno defaults, fixture usage, and server-side storage API names
- relax timing protocol test thresholds to reduce flaky assertions caused by timer jitter and sub-millisecond rounding
- align tapbundle commit metadata and dependency versions with the current package setup
## 2026-05-08 - 3.6.5 - fix(tapbundle_serverside)
allocate a free port when starting SmartStorage
+17 -17
View File
@@ -26,30 +26,30 @@
},
"devDependencies": {
"@git.zone/tsbuild": "^4.4.0",
"@types/node": "^25.5.0"
"@types/node": "^25.6.2"
},
"dependencies": {
"@git.zone/tsbundle": "^2.10.0",
"@git.zone/tsrun": "^2.0.1",
"@push.rocks/consolecolor": "^2.0.3",
"@push.rocks/qenv": "^6.1.3",
"@git.zone/tsbundle": "^2.10.1",
"@git.zone/tsrun": "^2.0.3",
"@push.rocks/consolecolor": "^2.0.4",
"@push.rocks/qenv": "^6.1.4",
"@push.rocks/smartbrowser": "^2.0.11",
"@push.rocks/smartcrypto": "^2.0.4",
"@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartenv": "^6.0.0",
"@push.rocks/smartdelay": "^3.1.0",
"@push.rocks/smartenv": "^6.1.0",
"@push.rocks/smartexpect": "^2.5.0",
"@push.rocks/smartfile": "^13.1.2",
"@push.rocks/smartfs": "^1.5.0",
"@push.rocks/smartjson": "^6.0.0",
"@push.rocks/smartlog": "^3.2.1",
"@push.rocks/smartmongo": "^5.1.0",
"@push.rocks/smartnetwork": "^4.5.2",
"@push.rocks/smartfile": "^13.1.3",
"@push.rocks/smartfs": "^1.5.1",
"@push.rocks/smartjson": "^6.0.1",
"@push.rocks/smartlog": "^3.2.2",
"@push.rocks/smartmongo": "^7.0.0",
"@push.rocks/smartnetwork": "^4.7.1",
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^5.0.1",
"@push.rocks/smartserve": "^2.0.3",
"@push.rocks/smartpromise": "^4.2.4",
"@push.rocks/smartrequest": "^5.0.3",
"@push.rocks/smartserve": "^2.0.4",
"@push.rocks/smartshell": "^3.3.8",
"@push.rocks/smartstorage": "^6.3.2",
"@push.rocks/smartstorage": "^6.5.1",
"@push.rocks/smarttime": "^4.2.3",
"@push.rocks/smartwatch": "^6.4.0",
"@types/ws": "^8.18.1",
+2020 -3026
View File
File diff suppressed because it is too large Load Diff
+14 -10
View File
@@ -2,15 +2,15 @@
🧪 **A powerful, modern test runner for TypeScript** — beautiful output, multi-runtime support, and a batteries-included test framework that makes testing actually enjoyable.
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Availability and Links
- [npmjs.org (npm package)](https://www.npmjs.com/package/@git.zone/tstest)
- [code.foss.global (source)](https://code.foss.global/git.zone/tstest)
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Why tstest?
Most TypeScript test runners feel like an afterthought — clunky configuration, ugly output, and poor TypeScript support. **tstest** was built from the ground up for TypeScript developers who want:
@@ -126,7 +126,7 @@ Name your test files with runtime specifiers to control where they run:
### Runtime Execution Order
When multiple runtimes are specified, tests execute in this order: **Node.js → Bun → Deno → Chromium**
When multiple runtimes are specified, tests execute in this order: **Node.js → Chromium → Deno → Bun**
### Migration from Legacy Naming
@@ -147,6 +147,7 @@ tstest migrate --write
| Option | Description |
|---|---|
| `--version` | Show the installed tstest version |
| `--quiet`, `-q` | Minimal output — perfect for CI |
| `--verbose`, `-v` | Show all console output from tests |
| `--no-color` | Disable colored output |
@@ -158,7 +159,6 @@ tstest migrate --write
| `--stopAt <n>` | Stop at test file number N |
| `--watch`, `-w` | Re-run tests on file changes |
| `--watch-ignore <patterns>` | Ignore patterns in watch mode |
| `--only` | Run only tests marked with `.only` |
## Writing Tests with tapbundle
@@ -287,7 +287,9 @@ tap.test('snapshot test', async (tools) => {
### Test Fixtures
```typescript
tap.defineFixture('testUser', async (data) => ({
import { tap, expect, TapTools } from '@git.zone/tstest/tapbundle';
TapTools.defineFixture('testUser', async (data) => ({
id: Date.now(),
name: data?.name || 'Test User',
email: data?.email || 'test@example.com',
@@ -368,8 +370,10 @@ expect(7).customAssertion(v => v % 2 === 1, 'Value is not odd');
For Node.js-only tests, import server-side utilities:
```typescript
import { tapNodeTools } from '@git.zone/tstest/tapbundle_serverside';
import { tap, expect } from '@git.zone/tstest/tapbundle';
import { TapNodeTools } from '@git.zone/tstest/tapbundle_serverside';
const tapNodeTools = new TapNodeTools(tap);
```
### 🌐 Network Utilities
@@ -437,7 +441,7 @@ await mongo.stop();
### 📦 Local S3 Storage
```typescript
const s3 = await tapNodeTools.createSmarts3();
const s3 = await tapNodeTools.createSmartStorage();
// ... run object storage tests ...
await s3.stop();
```
@@ -448,7 +452,7 @@ Control runtime behavior directly from your test files using special comment dir
### Deno Permissions
By default, Deno tests run with `--allow-read`, `--allow-env`, `--allow-net`, `--allow-write`, `--allow-sys`, and `--allow-import`. Add directives to request additional permissions:
By default, Deno tests run with `--allow-read`, `--allow-env`, `--allow-net`, `--allow-write`, `--allow-sys`, `--allow-import`, `--node-modules-dir`, and `--sloppy-imports`. Add directives to request additional permissions:
```typescript
// tstest:deno:allowAll
+7 -7
View File
@@ -170,8 +170,8 @@ tap.test('HrtMeasurement should capture accurate timing', async (tools) => {
measurement.stop();
// Should be at least 50ms
expect(measurement.milliSeconds).toBeGreaterThanOrEqual(50);
// Timers can resolve slightly below the requested delay due to sub-ms rounding.
expect(measurement.milliSeconds).toBeGreaterThanOrEqual(45);
// But not too much more (allow for some overhead)
expect(measurement.milliSeconds).toBeLessThan(100);
});
@@ -192,13 +192,13 @@ tap.test('multiple timing measurements should be independent', async (tools) =>
await tools.delayFor(25);
measurement2.stop();
// measurement1 should be ~50ms (25ms + 25ms)
expect(measurement1.milliSeconds).toBeGreaterThanOrEqual(50);
// measurement1 should be ~50ms (25ms + 25ms), allowing minor timer jitter.
expect(measurement1.milliSeconds).toBeGreaterThanOrEqual(45);
expect(measurement1.milliSeconds).toBeLessThan(70);
// measurement2 should be ~50ms (25ms + 25ms)
expect(measurement2.milliSeconds).toBeGreaterThanOrEqual(50);
// measurement2 should be ~50ms (25ms + 25ms), allowing minor timer jitter.
expect(measurement2.milliSeconds).toBeGreaterThanOrEqual(45);
expect(measurement2.milliSeconds).toBeLessThan(70);
});
tap.start();
tap.start();
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tstest',
version: '3.6.5',
version: '3.6.6',
description: 'A powerful, modern test runner for TypeScript with multi-runtime support (Node.js, Deno, Bun, Chromium) and a batteries-included test framework.'
}
+4 -4
View File
@@ -2,6 +2,10 @@
> 🚀 Multi-runtime TypeScript test runner with beautiful output and intelligent test orchestration
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Installation
```bash
@@ -9,10 +13,6 @@
pnpm install --save-dev @git.zone/tstest
```
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Overview
This is the core test runner module of `@git.zone/tstest`. It provides the CLI, test discovery, multi-runtime execution, TAP output parsing, structured logging, and test orchestration. It ties together the entire testing pipeline — from finding test files to dispatching them across Node.js, Chromium, Deno, Bun, and Docker runtimes.
+3 -3
View File
@@ -2,7 +2,7 @@
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/tapbundle',
version: '6.0.3',
description: 'A comprehensive testing automation library that provides a wide range of utilities and tools for TAP (Test Anything Protocol) based testing, especially suitable for projects using tapbuffer.'
name: '@git.zone/tstest/tapbundle',
version: '3.6.5',
description: 'Core TAP testing framework with enhanced assertions and lifecycle hooks.'
}
+10 -28
View File
@@ -2,6 +2,10 @@
> 🧪 Core TAP testing framework with enhanced assertions and lifecycle hooks
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Installation
```bash
@@ -9,10 +13,6 @@
pnpm install --save-dev @git.zone/tstest
```
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Overview
`@git.zone/tstest/tapbundle` is the core testing framework module that provides the TAP (Test Anything Protocol) implementation for tstest. It offers a comprehensive API for writing and organizing tests with support for lifecycle hooks, test suites, enhanced assertions with diff generation, and flexible test configuration.
@@ -393,21 +393,14 @@ tap.test('second test', async (tapTools) => {
```typescript
// Define a fixture globally (outside tests)
import { TapTools } from '@git.zone/tstest/tapbundle';
import { tap, TapTools } from '@git.zone/tstest/tapbundle';
TapTools.defineFixture('database', async () => {
const db = await createTestDatabase();
return {
value: db,
cleanup: async () => await db.close()
};
});
TapTools.defineFixture('database', async () => createTestDatabase());
// Use fixtures in tests
tap.test('database test', async (tapTools) => {
const db = await tapTools.fixture('database');
// Use db...
// Cleanup happens automatically
});
```
@@ -415,27 +408,16 @@ tap.test('database test', async (tapTools) => {
```typescript
// Define a factory
TapTools.defineFixture('user', async () => {
return {
value: null, // Not used for factories
factory: async (data) => {
return await createUser(data);
},
cleanup: async (user) => await user.delete()
};
});
TapTools.defineFixture('user', async (data) => createUser(data));
// Use factory in tests
tap.test('user test', async (tapTools) => {
const user = await tapTools.factory('user').create({ name: 'Alice' });
// Create multiple
const users = await tapTools.factory('user').createMany([
{ name: 'Alice' },
{ name: 'Bob' }
]);
// Cleanup happens automatically
const users = await tapTools.factory('user').createMany(2, (index) => ({
name: index === 0 ? 'Alice' : 'Bob',
}));
});
```
+4 -4
View File
@@ -2,6 +2,10 @@
> 📡 Enhanced TAP Protocol V2 implementation for structured test communication
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Installation
```bash
@@ -9,10 +13,6 @@
pnpm install --save-dev @git.zone/tstest
```
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Overview
`@git.zone/tstest/tapbundle_protocol` implements Protocol V2, an enhanced version of the Test Anything Protocol (TAP) with support for structured metadata, real-time events, error diffs, and isomorphic operation. This protocol enables rich communication between test runners and test consumers while maintaining backward compatibility with standard TAP parsers.
+6 -6
View File
@@ -2,6 +2,10 @@
> 🔧 Server-side testing utilities for Node.js runtime tests
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Installation
```bash
@@ -9,10 +13,6 @@
pnpm install --save-dev @git.zone/tstest
```
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## Overview
`@git.zone/tstest/tapbundle_serverside` provides server-side testing utilities exclusively for Node.js runtime. These tools make it trivial to spin up test infrastructure — free ports, HTTPS certificates, ephemeral databases, S3 storage, shell commands, and environment variable management.
@@ -209,7 +209,7 @@ Uses [@push.rocks/smartmongo](https://code.foss.global/push.rocks/smartmongo).
### 📦 Storage Testing
#### `createSmarts3()`
#### `createSmartStorage()`
Create a local S3-compatible storage instance for testing.
@@ -219,7 +219,7 @@ const s3 = await tapNodeTools.createSmartStorage();
await s3.stop();
```
Default config: port 3003, clean slate enabled. Uses [@push.rocks/smartstorage](https://code.foss.global/push.rocks/smartstorage).
Default config: first free port starting at 3003, clean slate enabled. Uses [@push.rocks/smartstorage](https://code.foss.global/push.rocks/smartstorage).
---