Compare commits

...

4 Commits

4 changed files with 19 additions and 2 deletions

View File

@ -1,5 +1,16 @@
# Changelog
## 2025-01-23 - 1.0.94 - fix(TsTest)
Fix test module execution by ensuring promise resolution delay
- Added a delay to ensure promise resolution when dynamically importing test modules in the runInChrome method.
## 2025-01-23 - 1.0.93 - fix(tstest)
Handle globalThis.tapPromise in browser runtime evaluation
- Added support for using globalThis.tapPromise in the browser evaluation logic.
- Added log messages to indicate the usage of globalThis.tapPromise.
## 2025-01-23 - 1.0.92 - fix(core)
Improve error logging for test modules without default promise

View File

@ -1,6 +1,6 @@
{
"name": "@git.zone/tstest",
"version": "1.0.92",
"version": "1.0.94",
"private": false,
"description": "a test utility to run tests that match test/**/*.ts",
"main": "dist_ts/index.js",

View File

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

View File

@ -170,6 +170,7 @@ export class TsTest {
try {
// Dynamically import the test module
const testModule = await import(`/${bundleName}`);
await plugins.smartdelay.delayFor(0);
if (testModule && testModule.default && testModule.default instanceof Promise) {
// Execute the exported test function
await testModule.default;
@ -178,6 +179,11 @@ export class TsTest {
console.log('Test module default export is just promiselike: Something might be messing with your Promise implementation.');
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
await testModule.default;
} else if (globalThis.tapPromise && globalThis.tapPromise.then === 'function') {
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
console.log('Using globalThis.tapPromise');
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
await testModule.default;
} else {
console.error('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
console.error('Test module does not export a default promise.');