fix(tapbundle): Pass TapTools to suite lifecycle hooks (beforeAll/afterAll) and update @push.rocks/smarts3 to ^3.0.0

This commit is contained in:
2025-11-21 15:17:37 +00:00
parent 97c91fc010
commit 8edbbd4850
5 changed files with 101 additions and 579 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## 2025-11-21 - 3.1.1 - fix(tapbundle)
Pass TapTools to suite lifecycle hooks (beforeAll/afterAll) and update @push.rocks/smarts3 to ^3.0.0
- Replace usage of a Deferred promise with a TapTools instance when invoking suite.beforeAll and suite.afterAll
- Add import for TapTools in ts_tapbundle/tapbundle.classes.tap.ts
- Bump dependency @push.rocks/smarts3 from ^2.2.7 to ^3.0.0 in package.json
## 2025-11-20 - 3.1.0 - feat(tapbundle)
Add global postTask (teardown) and suite lifecycle hooks (beforeAll/afterAll) to tapbundle

View File

@@ -48,7 +48,7 @@
"@push.rocks/smartpath": "^6.0.0",
"@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrequest": "^5.0.1",
"@push.rocks/smarts3": "^2.2.7",
"@push.rocks/smarts3": "^3.0.0",
"@push.rocks/smartshell": "^3.3.0",
"@push.rocks/smarttime": "^4.1.1",
"@types/ws": "^8.18.1",

664
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -3,6 +3,7 @@ import * as plugins from './tapbundle.plugins.js';
import { type IPreTaskFunction, PreTask } from './tapbundle.classes.pretask.js';
import { type IPostTaskFunction, PostTask } from './tapbundle.classes.posttask.js';
import { TapTest, type ITestFunction } from './tapbundle.classes.taptest.js';
import { TapTools } from './tapbundle.classes.taptools.js';
import { ProtocolEmitter, type ITestEvent } from '../dist_ts_tapbundle_protocol/index.js';
import type { ITapSettings } from './tapbundle.interfaces.js';
import { SettingsManager } from './tapbundle.classes.settingsmanager.js';
@@ -645,7 +646,7 @@ export class Tap<T> {
// Run beforeAll hook for this suite
if (suite.beforeAll) {
await suite.beforeAll(new plugins.smartpromise.Deferred().promise as any);
await suite.beforeAll(new TapTools(null as any));
}
// Run beforeEach from parent suites
@@ -720,7 +721,7 @@ export class Tap<T> {
// Run afterAll hook for this suite
if (suite.afterAll) {
await suite.afterAll(new plugins.smartpromise.Deferred().promise as any);
await suite.afterAll(new TapTools(null as any));
}
// Emit suite:completed event