From a73ce99564febebc365a00bb5add6530f8254a39 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 23 Jan 2025 19:25:13 +0100 Subject: [PATCH] fix(TsTest): Fix test module execution by ensuring promise resolution delay --- changelog.md | 5 +++++ ts/00_commitinfo_data.ts | 2 +- ts/tstest.classes.tstest.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index bea0cd5..572de8f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # 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 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 5516a58..0644dfc 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tstest', - version: '1.0.93', + version: '1.0.94', description: 'a test utility to run tests that match test/**/*.ts' } diff --git a/ts/tstest.classes.tstest.ts b/ts/tstest.classes.tstest.ts index 81f9e79..52edd41 100644 --- a/ts/tstest.classes.tstest.ts +++ b/ts/tstest.classes.tstest.ts @@ -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;