fix(core): Refactored tstest class to enhance promise handling for test modules.

This commit is contained in:
2025-01-23 19:02:11 +01:00
parent 4cce132472
commit a8e9f67810
7 changed files with 8040 additions and 3381 deletions

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@git.zone/tstest',
version: '1.0.90',
version: '1.0.91',
description: 'a test utility to run tests that match test/**/*.ts'
}

View File

@ -173,6 +173,11 @@ export class TsTest {
if (testModule && testModule.default && testModule.default instanceof Promise) {
// Execute the exported test function
await testModule.default;
} else if (testModule && testModule.default && testModule.default.then === 'function') {
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
console.log('Test module default export is just promiselike: Something might be messing with your Promise implementation.');
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
await testModule.default;
} else {
console.error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
console.error('Test module does not export a default promise.');