diff --git a/changelog.md b/changelog.md index 7dfe4dc..23d9027 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-12-30 - 3.1.4 - fix(webhelpers) +improve browser test fixture to append element and await custom element upgrade and Lit update completion; add generic return type; update npm packaging release config; remove pnpm onlyBuiltDependencies + +- ts_tapbundle/webhelpers.ts: make fixture generic and return T; append created element to document; await customElements.whenDefined for custom elements and await updateComplete for Lit/async components to ensure stable rendering in tests +- npmextra.json: add @git.zone/cli module metadata and release.registries/accessLevel; add @ship.zone/szci entry +- pnpm-workspace.yaml: remove onlyBuiltDependencies entries + ## 2025-11-21 - 3.1.3 - fix(docs) Update package author and expand license/legal and issue-reporting information in tapbundle docs diff --git a/npmextra.json b/npmextra.json index 23b0da4..4ae23f7 100644 --- a/npmextra.json +++ b/npmextra.json @@ -1,9 +1,5 @@ { - "npmci": { - "npmGlobalTools": [], - "npmAccessLevel": "public" - }, - "gitzone": { + "@git.zone/cli": { "projectType": "npm", "module": { "githost": "code.foss.global", @@ -12,6 +8,16 @@ "description": "a test utility to run tests that match test/**/*.ts", "npmPackagename": "@git.zone/tstest", "license": "MIT" + }, + "release": { + "registries": [ + "https://verdaccio.lossless.digital", + "https://registry.npmjs.org" + ], + "accessLevel": "public" } + }, + "@ship.zone/szci": { + "npmGlobalTools": [] } } \ No newline at end of file diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml deleted file mode 100644 index 512ab5a..0000000 --- a/pnpm-workspace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -onlyBuiltDependencies: - - esbuild - - mongodb-memory-server - - puppeteer diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 8f1c0af..c8eae09 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: '3.1.3', + version: '3.1.4', description: 'a test utility to run tests that match test/**/*.ts' } diff --git a/ts_tapbundle/webhelpers.ts b/ts_tapbundle/webhelpers.ts index 211454c..f8c7132 100644 --- a/ts_tapbundle/webhelpers.ts +++ b/ts_tapbundle/webhelpers.ts @@ -22,10 +22,24 @@ class WebHelpers { // Initialize fixture function based on environment if (smartenv.isBrowser) { - this.fixture = async (htmlString: string): Promise => { + this.fixture = async (htmlString: string): Promise => { const container = document.createElement('div'); container.innerHTML = htmlString.trim(); - const element = container.firstChild as HTMLElement; + const element = container.firstElementChild as T; + + // Append to document so custom elements upgrade and lifecycle hooks fire + document.body.appendChild(element); + + // Wait for custom element definition if it's a custom element + if (element.localName.includes('-')) { + await customElements.whenDefined(element.localName).catch(() => {}); + } + + // Wait for Lit/async components to finish rendering + if ((element as any).updateComplete) { + await (element as any).updateComplete; + } + return element; }; } else {