fix: Typing on toHaveHTML should allow HTMLOptions#2090
Conversation
Greptile SummaryThis PR fixes a type-declaration mismatch in Confidence Score: 5/5Safe to merge — the change is a one-line type correction that aligns the public declaration with the existing runtime implementation. The fix is minimal, correct, and backward-compatible ( No files require special attention.
|
| Filename | Overview |
|---|---|
| types/expect-webdriverio.d.ts | Changed toHaveHTML option type from StringOptions to HTMLOptions, which correctly extends StringOptions with includeSelectorTag. The implementation already used HTMLOptions, so this aligns the declaration with runtime behavior. |
| test-types/mocha/types-mocha.test.ts | Added a type-level test verifying toHaveHTML accepts { includeSelectorTag: true }. Only the mocha variant was updated; the jasmine/jest equivalents were not, though this is non-blocking since the shared .d.ts covers all frameworks. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class CommandOptions {
+message?: string
}
class StringOptions {
+ignoreCase?: boolean
+trim?: boolean
+containing?: boolean
}
class HTMLOptions {
+includeSelectorTag?: boolean
}
CommandOptions <|-- StringOptions
StringOptions <|-- HTMLOptions
class toHaveHTML {
+html: string | RegExp | PartialMatcher | Array
+options?: HTMLOptions
}
toHaveHTML --> HTMLOptions : uses (was StringOptions)
Reviews (1): Last reviewed commit: "fix: Typing on toHaveHTML should allow H..." | Re-trigger Greptile
Fixes #2089
toHaveHTMLshould be usingHTMLOptionsand not only StringOptions to allow passingincludeSelectorTag