Skip to content

Lupa API Reference / assert/types / SemanticDomOptions

Interface: SemanticDomOptions

Defined in: src/assert/types.ts:91

Options for Semantic DOM assertions

Properties

ignoreAttributeValueFor?

optional ignoreAttributeValueFor?: (string | AttributeMatcher)[]

Defined in: src/assert/types.ts:105

The attribute MUST exist, but we ignore its value during comparison. Example: ['data-id', 'aria-describedby'] Or target specific tags: [{ tags: ['input'], attributes: ['id'] }]


ignoreChildren?

optional ignoreChildren?: string[]

Defined in: src/assert/types.ts:117

Ignores elements that match the given CSS selectors (removes them from the tree). Example: ['.item', '#dynamic-child']


ignoredAttributes?

optional ignoredAttributes?: "*" | (string | AttributeMatcher)[]

Defined in: src/assert/types.ts:98

Completely ignore specific attributes.

  • '*': Ignores ALL attributes on all elements.
  • ['class', 'id']: Ignores these attributes globally.
  • [{ tags: ['input'], attributes: ['id'] }]: Ignores specific attributes on specific tags.

ignoreTags?

optional ignoreTags?: string[]

Defined in: src/assert/types.ts:111

Ignores specific tags completely from the comparison (removes them from the tree). Example: ['my-custom-element']


ignoreTextContent?

optional ignoreTextContent?: boolean

Defined in: src/assert/types.ts:122

If true, all text nodes (inner text content) are ignored in the comparison.