Compare commits

...

4 Commits
v3.1.6 ... main

9 changed files with 28 additions and 10 deletions

View File

@@ -1,5 +1,18 @@
# Changelog
## 2026-01-25 - 3.1.8 - fix(tapbundle)
treat tests that call tools.allowFailure() as passing and update tests to use tools parameter
- Set testResult.ok to this.failureAllowed so allowed failures are considered passing in the tap test runner implementation (ts_tapbundle/tapbundle.classes.taptest.ts).
- Updated multiple tests to accept the tools parameter and call tools.allowFailure() where failures are intended (test/tapbundle/test.performance-metrics.ts, test/tstest/test.fail.ts, test/tstest/test.failing-with-logs.ts).
- Prevents intentionally-failing tests from skewing timing/metric calculations and preserves console logs for allowed failures.
## 2026-01-25 - 3.1.7 - fix(tap-parser)
append newline to WebSocket tap log messages to ensure proper line-by-line processing
- Fixes handling of WebSocket console.log messages by appending a trailing newline before processing to avoid merged lines.
- Modified ts/tstest.classes.tap.parser.ts: handleTapLog now calls _processLog(tapLog + '\n').
## 2026-01-19 - 3.1.6 - fix(logging)
handle mid-line streaming output in test logger and add streaming tests

View File

@@ -9,5 +9,5 @@
"target": "ES2022"
},
"nodeModulesDir": true,
"version": "3.1.6"
"version": "3.1.8"
}

View File

@@ -1,6 +1,6 @@
{
"name": "@git.zone/tstest",
"version": "3.1.6",
"version": "3.1.8",
"private": false,
"description": "a test utility to run tests that match test/**/*.ts",
"exports": {

View File

@@ -47,6 +47,7 @@ tap.test('metric test fast 3 - minimal work', async () => {
// Test to verify that failed tests still contribute to timing metrics
tap.test('metric test that fails - 60ms before failure', async (tools) => {
tools.allowFailure();
await tools.delayFor(60);
expect(true).toBeFalse(); // This will fail
});

View File

@@ -1,6 +1,7 @@
import { expect, tap } from '../../ts_tapbundle/index.js';
tap.test('This test should fail', async () => {
tap.test('This test should fail', async (tools) => {
tools.allowFailure();
console.log('This test will fail on purpose');
expect(true).toBeFalse();
});

View File

@@ -1,6 +1,7 @@
import { expect, tap } from '../../ts_tapbundle/index.js';
tap.test('Test that will fail with console logs', async () => {
tap.test('Test that will fail with console logs', async (tools) => {
tools.allowFailure();
console.log('Starting the test...');
console.log('Doing some setup work');
console.log('About to check assertion');

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tstest',
version: '3.1.6',
version: '3.1.8',
description: 'a test utility to run tests that match test/**/*.ts'
}

View File

@@ -487,7 +487,9 @@ export class TapParser {
}
public async handleTapLog(tapLog: string) {
this._processLog(tapLog);
// Each WebSocket message represents a complete console.log() call,
// so append newline to ensure proper line-by-line processing
this._processLog(tapLog + '\n');
}
/**

View File

@@ -261,7 +261,7 @@ export class TapTest<T = unknown> {
// Final failure
const testResult = {
ok: false,
ok: this.failureAllowed, // Pass if failure is allowed
testNumber,
description: this.description,
metadata: {