Skip to content

Commit 9b4a88b

Browse files
authored
Merge pull request #2090 from dprevost-LMI/fix-typing-not-allowing-HTMLOptions-with-toHaveHTML
fix: Typing on toHaveHTML should allow HTMLOptions
2 parents b5e4e13 + b436337 commit 9b4a88b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

test-types/mocha/types-mocha.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ describe('type assertions', () => {
8383
})
8484
})
8585

86+
describe('toHaveHTML', () => {
87+
it('should allow using HTMLOptions', async () => {
88+
expectPromiseVoid = expect(element).toHaveHTML('html', { includeSelectorTag: true })
89+
})
90+
})
91+
8692
describe('element', () => {
8793

8894
describe('toBeDisabled', () => {

types/expect-webdriverio.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
320320
*/
321321
toHaveHTML: FnWhenElementOrArrayLike<ActualT, (
322322
html: string | RegExp | ExpectWebdriverIO.PartialMatcher<string> | Array<string | RegExp>,
323-
options?: ExpectWebdriverIO.StringOptions
323+
options?: ExpectWebdriverIO.HTMLOptions
324324
) => Promise<void>>
325325

326326
/**

0 commit comments

Comments
 (0)