From ec91c51a728f7f866a83d25d9ddfd0f9473e962b Mon Sep 17 00:00:00 2001 From: smhxx Date: Tue, 23 Jan 2018 12:32:16 -0600 Subject: [PATCH] chai, chai-dom, chai-jquery: fix signature of match()/matches() methods (#23077) * chai: fix signature of match()/matches() methods * chai-dom: add missing assertions from recent minor versions * chai-jquery: add missing declaration caused by changes to @types/chai --- types/chai-dom/index.d.ts | 18 ++++++++++++++++++ types/chai-jquery/index.d.ts | 4 ++++ types/chai/index.d.ts | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/types/chai-dom/index.d.ts b/types/chai-dom/index.d.ts index 4338de92e2..8650ebca1d 100644 --- a/types/chai-dom/index.d.ts +++ b/types/chai-dom/index.d.ts @@ -23,6 +23,18 @@ declare namespace Chai { value(text: string): Assertion; + empty: Assertion; + + // exist, length, and contain are already defined in @types/chai and have the + // same type or a more general type, so don't need to be re-declared even though + // the implementation is different + + descendant(element: string|HTMLElement): Assertion; + + descendants(selector: string): Assertion; + + displayed: Assertion; + } interface Include { @@ -33,6 +45,12 @@ declare namespace Chai { } + interface Match { + + (selector: string): Assertion; + + } + } declare module "chai-dom" { diff --git a/types/chai-jquery/index.d.ts b/types/chai-jquery/index.d.ts index e84a1ec272..bd6826ca08 100644 --- a/types/chai-jquery/index.d.ts +++ b/types/chai-jquery/index.d.ts @@ -27,6 +27,10 @@ declare namespace Chai { disabled(): Assertion; (selector: string): Assertion; } + + interface Match { + (selector: string): Assertion; + } } /** diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 925c7198f0..02bca8909f 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -226,7 +226,7 @@ declare namespace Chai { } interface Match { - (regexp: RegExp|string, message?: string): Assertion; + (regexp: RegExp, message?: string): Assertion; } interface Keys {