From 30af8f7c653b6fd690444fa68408ddaee54ec8e6 Mon Sep 17 00:00:00 2001 From: William Orr Date: Tue, 7 Jul 2020 00:11:38 +0200 Subject: [PATCH] Add missing chai-as-promised assert functions (#45784) --- types/chai-as-promised/index.d.ts | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/types/chai-as-promised/index.d.ts b/types/chai-as-promised/index.d.ts index e3a19cd761..51e2a07aa3 100644 --- a/types/chai-as-promised/index.d.ts +++ b/types/chai-as-promised/index.d.ts @@ -5,6 +5,7 @@ // Leonard Thieu , // Mike Lazer-Walker , // Matt Bishop +// William Orr // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.0 @@ -313,6 +314,7 @@ declare namespace Chai { isNumber(val: any, msg?: string): PromiseLike; isNotNumber(val: any, msg?: string): PromiseLike; + isFinite(val: number, msg?: string): PromiseLike; isBoolean(val: any, msg?: string): PromiseLike; isNotBoolean(val: any, msg?: string): PromiseLike; @@ -329,6 +331,24 @@ declare namespace Chai { notInclude(exp: string, inc: any, msg?: string): PromiseLike; notInclude(exp: any[], inc: any, msg?: string): PromiseLike; + deepInclude(exp: string, inc: any, msg?: string): PromiseLike; + deepInclude(exp: any[], inc: any, msg?: string): PromiseLike; + + notDeepInclude(exp: string, inc: any, msg?: string): PromiseLike; + notDeepInclude(exp: any[], inc: any, msg?: string): PromiseLike; + + nestedInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + notNestedInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + + deepNestedInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + notDeepNestedInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + + ownInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + notOwnInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + + deepOwnInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + notDeepOwnInclude(exp: Object, inc: Object, msg?: string): PromiseLike; + match(exp: any, re: RegExp, msg?: string): PromiseLike; notMatch(exp: any, re: RegExp, msg?: string): PromiseLike; @@ -343,7 +363,46 @@ declare namespace Chai { deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + nestedProperty(obj: object, prop: string, msg?: string): PromiseLike; + notNestedProperty(obj: object, prop: string, msg?: string): PromiseLike; + nestedPropertyVal(obj: object, prop: string, val: any, msg?: string): PromiseLike; + notNestedPropertyVal(obj: object, prop: string, val: any, msg?: string): PromiseLike; + + deepNestedPropertyVal(obj: object, prop: string, val: any, msg?: string): PromiseLike; + notDeepNestedPropertyVal(obj: object, prop: string, val: any, msg?: string): PromiseLike; + lengthOf(exp: any, len: number, msg?: string): PromiseLike; + + hasAnyKeys(obj: any, keys: any[], msg?: string): PromiseLike; + hasAnyKeys(obj: any, keys: object, msg?: string): PromiseLike; + + hasAllKeys(obj: any, keys: any[], msg?: string): PromiseLike; + hasAllKeys(obj: any, keys: object, msg?: string): PromiseLike; + + containsAllKeys(obj: any, keys: any[], msg?: string): PromiseLike; + containsAllKeys(obj: any, keys: object, msg?: string): PromiseLike; + + doesNotHaveAnyKeys(obj: any, keys: any[], msg?: string): PromiseLike; + doesNotHaveAnyKeys(obj: any, keys: object, msg?: string): PromiseLike; + + doesNotHaveAllKeys(obj: any, keys: any[], msg?: string): PromiseLike; + doesNotHaveAllKeys(obj: any, keys: object, msg?: string): PromiseLike; + + hasAnyDeepKeys(obj: any, keys: any[], msg?: string): PromiseLike; + hasAnyDeepKeys(obj: any, keys: object, msg?: string): PromiseLike; + + hasAllDeepKeys(obj: any, keys: any[], msg?: string): PromiseLike; + hasAllDeepKeys(obj: any, keys: object, msg?: string): PromiseLike; + + containsAllDeepKeys(obj: any, keys: any[], msg?: string): PromiseLike; + containsAllDeepKeys(obj: any, keys: object, msg?: string): PromiseLike; + + doesNotHaveAnyDeepKeys(obj: any, keys: any[], msg?: string): PromiseLike; + doesNotHaveAnyDeepKeys(obj: any, keys: object, msg?: string): PromiseLike; + + doesNotHaveAllDeepKeys(obj: any, keys: any[], msg?: string): PromiseLike; + doesNotHaveAllDeepKeys(obj: any, keys: object, msg?: string): PromiseLike; + //alias frenzy throw(fn: Function, msg?: string): PromiseLike; throw(fn: Function, regExp: RegExp): PromiseLike; @@ -385,11 +444,17 @@ declare namespace Chai { oneOf(val: any, list: any[], msg?: string): PromiseLike; changes(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + changesBy(modifier: Function, obj: object, property: string, change: number, msg?: string): PromiseLike; doesNotChange(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + changesButNotBy(modifier: Function, obj: object, property: string, change: number, msg?: string): PromiseLike; increases(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + increasesBy(modifier: Function, obj: Object, property: string, change: number, msg?: string): PromiseLike; doesNotIncrease(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + increasesButNotBy(modifier: Function, obj: Object, property: string, change: number, msg?: string): PromiseLike; decreases(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + decreasesBy(modifier: Function, obj: Object, property: string, change: number, msg?: string): PromiseLike; doesNotDecrease(modifier: Function, obj: Object, property: string, msg?: string): PromiseLike; + decreasesButNotBy(modifier: Function, obj: Object, property: string, change: number, msg?: string): PromiseLike; ifError(val: any, msg?: string): PromiseLike;