Skip to content

Commit 035dd83

Browse files
committed
Add Jsdoc description to litRuntime.ts, implement new interface contract
1 parent 1825237 commit 035dd83

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/components/Test/webComponent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ export class TestWebComponent extends LitElement {
3434
}
3535
}
3636

37-
export const registerWebComponent = (tagName = TestWebComponent.registeredName) =>
37+
export const registerWebComponent = async (tagName = TestWebComponent.registeredName) => {
3838
defineCustomElement(tagName, TestWebComponent)
39+
}
3940

4041
export const webComponentModule: WebComponentModule<TestWebComponent> = {
4142
registeredName: TestWebComponent.registeredName,

src/components/scripts/@types/webComponentModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import type { LitElement } from 'lit'
33
export interface WebComponentModule<TElement extends LitElement = LitElement> {
44
registeredName: string
55
componentCtor: CustomElementConstructor & { prototype: TElement }
6-
registerWebComponent: (tagName?: string) => Promise<void> | void
6+
registerWebComponent: (_tagName?: string) => Promise<void> | void
77
}

test/unit/helpers/litRuntime.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Provides Happy DOM utilities for Lit-powered Astro component tests.
3+
* The helpers create scoped browser globals, load WebComponentModule contracts,
4+
* render Astro templates into sanitized DOM trees, and assert against the upgraded elements.
5+
*/
16
import { Window } from 'happy-dom'
27
import type HappyDomNode from 'happy-dom/lib/nodes/node/Node'
38
import type HappyDomDocumentFragment from 'happy-dom/lib/nodes/document-fragment/DocumentFragment'

0 commit comments

Comments
 (0)