,
- property: (
- (name: string, value?: P) => ExpectChain
- & (name: string) => ExpectChain
- ),
-
- length: (value: number) => ExpectChain | ExpectChain,
- lengthOf: (value: number) => ExpectChain,
-
- match: (regex: RegExp) => ExpectChain,
- string: (string: string) => ExpectChain,
-
- key: (key: string) => ExpectChain,
- keys: (key: string | Array, ...keys: Array) => ExpectChain,
-
- throw: (
- err?: Class | Error | RegExp | string,
- errMsgMatcher?: RegExp | string,
- msg?: string) => ExpectChain,
-
- respondTo: (method: string) => ExpectChain,
- itself: ExpectChain,
-
- satisfy: (method: (value: T) => bool) => ExpectChain,
-
- closeTo: (expected: T & number, delta: number) => ExpectChain,
-
- members: (set: mixed) => ExpectChain,
- oneOf: (list: Array) => ExpectChain,
-
- change: (obj: mixed, key: string) => ExpectChain,
- increase: (obj: mixed, key: string) => ExpectChain,
- decrease: (obj: mixed, key: string) => ExpectChain,
-
- // dirty-chai
- ok: () => ExpectChain,
- true: () => ExpectChain,
- false: () => ExpectChain,
- null: () => ExpectChain,
- undefined: () => ExpectChain,
- exist: () => ExpectChain,
- empty: () => ExpectChain,
-
- extensible: () => ExpectChain,
- sealed: () => ExpectChain,
- frozen: () => ExpectChain,
-
- // chai-immutable
- size: (n: number) => ExpectChain,
-
- // sinon-chai
- called: () => ExpectChain,
- callCount: (n: number) => ExpectChain,
- calledOnce: () => ExpectChain,
- calledTwice: () => ExpectChain,
- calledThrice: () => ExpectChain,
- calledBefore: (spy: mixed) => ExpectChain,
- calledAfter: (spy: mixed) => ExpectChain,
- calledWith: (...args: Array) => ExpectChain,
- calledWithMatch: (...args: Array) => ExpectChain,
- calledWithExactly: (...args: Array) => ExpectChain,
-
- // chai-as-promised
- eventually: ExpectChain,
- resolvedWith: (value: mixed) => Promise & ExpectChain,
- resolved: () => Promise & ExpectChain,
- rejectedWith: (value: mixed) => Promise & ExpectChain,
- rejected: () => Promise & ExpectChain,
- notify: (callback: () => mixed) => ExpectChain,
- fulfilled: () => Promise & ExpectChain,
-
- // chai-subset
- containSubset: (obj: Object | Object[]) => ExpectChain
- };
-
- declare function expect(actual: T): ExpectChain;
-
- declare function use(plugin: (chai: Object, utils: Object) => void): void;
-
- declare class assert {
- static(expression: mixed, message?: string): void;
- static fail(actual: mixed, expected: mixed, message?: string, operator?: string): void;
-
- static isOk(object: mixed, message?: string): void;
- static isNotOk(object: mixed, message?: string): void;
-
- static equal(actual: mixed, expected: mixed, message?: string): void;
- static notEqual(actual: mixed, expected: mixed, message?: string): void;
-
- static strictEqual(act: mixed, exp: mixed, msg?: string): void;
- static notStrictEqual(act: mixed, exp: mixed, msg?: string): void;
-
- static deepEqual(act: mixed, exp: mixed, msg?: string): void;
- static notDeepEqual(act: mixed, exp: mixed, msg?: string): void;
-
- static ok(val: mixed, msg?: string): void;
- static isTrue(val: mixed, msg?: string): void;
- static isNotTrue(val: mixed, msg?: string): void;
- static isFalse(val: mixed, msg?: string): void;
- static isNotFalse(val: mixed, msg?: string): void;
-
- static isNull(val: mixed, msg?: string): void;
- static isNotNull(val: mixed, msg?: string): void;
-
- static isUndefined(val: mixed, msg?: string): void;
- static isDefined(val: mixed, msg?: string): void;
-
- static isNaN(val: mixed, msg?: string): void;
- static isNotNaN(val: mixed, msg?: string): void;
-
- static isAbove(val: number, abv: number, msg?: string): void;
- static isBelow(val: number, blw: number, msg?: string): void;
-
- static isAtMost(val: number, atmst: number, msg?: string): void;
- static isAtLeast(val: number, atlst: number, msg?: string): void;
-
- static isFunction(val: mixed, msg?: string): void;
- static isNotFunction(val: mixed, msg?: string): void;
-
- static isObject(val: mixed, msg?: string): void;
- static isNotObject(val: mixed, msg?: string): void;
-
- static isArray(val: mixed, msg?: string): void;
- static isNotArray(val: mixed, msg?: string): void;
-
- static isString(val: mixed, msg?: string): void;
- static isNotString(val: mixed, msg?: string): void;
-
- static isNumber(val: mixed, msg?: string): void;
- static isNotNumber(val: mixed, msg?: string): void;
-
- static isBoolean(val: mixed, msg?: string): void;
- static isNotBoolean(val: mixed, msg?: string): void;
-
- static typeOf(val: mixed, type: string, msg?: string): void;
- static notTypeOf(val: mixed, type: string, msg?: string): void;
-
- static instanceOf(val: mixed, constructor: Function, msg?: string): void;
- static notInstanceOf(val: mixed, constructor: Function, msg?: string): void;
-
- static include(exp: string, inc: mixed, msg?: string): void;
- static include(exp: Array, inc: T, msg?: string): void;
-
- static notInclude(exp: string, inc: mixed, msg?: string): void;
- static notInclude(exp: Array, inc: T, msg?: string): void;
-
- static match(exp: mixed, re: RegExp, msg?: string): void;
- static notMatch(exp: mixed, re: RegExp, msg?: string): void;
-
- static property(obj: Object, prop: string, msg?: string): void;
- static notProperty(obj: Object, prop: string, msg?: string): void;
- static deepProperty(obj: Object, prop: string, msg?: string): void;
- static notDeepProperty(obj: Object, prop: string, msg?: string): void;
-
- static propertyVal(obj: Object, prop: string, val: mixed, msg?: string): void;
- static propertyNotVal(obj: Object, prop: string, val: mixed, msg?: string): void;
-
- static deepPropertyVal(obj: Object, prop: string, val: mixed, msg?: string): void;
- static deepPropertyNotVal(obj: Object, prop: string, val: mixed, msg?: string): void;
-
- static lengthOf(exp: mixed, len: number, msg?: string): void;
-
- static throws(
- func: () => any,
- err?: Class | Error | RegExp | string,
- errorMsgMatcher?: string | RegExp,
- msg?: string): void;
- static doesNotThrow(
- func: () => any,
- err?: Class | Error | RegExp | string,
- errorMsgMatcher?: string | RegExp,
- msg?: string): void;
- }
-
- declare var config: {
- includeStack: boolean,
- showDiff: boolean,
- truncateThreshold: number
- };
+ declare type ExpectChain = {
+ and: ExpectChain,
+ at: ExpectChain,
+ be: ExpectChain,
+ been: ExpectChain,
+ have: ExpectChain,
+ has: ExpectChain,
+ is: ExpectChain,
+ of: ExpectChain,
+ same: ExpectChain,
+ that: ExpectChain,
+ to: ExpectChain,
+ which: ExpectChain,
+ with: ExpectChain,
+
+ not: ExpectChain,
+ deep: ExpectChain,
+ any: ExpectChain,
+ all: ExpectChain,
+
+ a: ExpectChain & ((type: string) => ExpectChain),
+ an: ExpectChain & ((type: string) => ExpectChain),
+
+ include: ExpectChain & ((value: mixed) => ExpectChain),
+ includes: ExpectChain & ((value: mixed) => ExpectChain),
+ contain: ExpectChain & ((value: mixed) => ExpectChain),
+ contains: ExpectChain & ((value: mixed) => ExpectChain),
+
+ eql: (value: T) => ExpectChain,
+ equal: (value: T) => ExpectChain,
+ equals: (value: T) => ExpectChain,
+
+ above: (value: T & number) => ExpectChain,
+ least: (value: T & number) => ExpectChain,
+ below: (value: T & number) => ExpectChain,
+ most: (value: T & number) => ExpectChain,
+ within: (start: T & number, finish: T & number) => ExpectChain,
+
+ instanceof: (constructor: mixed) => ExpectChain,
+ nested: ExpectChain,
+ property: (
+ name: string,
+ value?: P
+ ) => ExpectChain
& ((name: string) => ExpectChain),
+
+ length: (value: number) => ExpectChain | ExpectChain,
+ lengthOf: (value: number) => ExpectChain,
+
+ match: (regex: RegExp) => ExpectChain,
+ string: (string: string) => ExpectChain,
+
+ key: (key: string) => ExpectChain,
+ keys: (
+ key: string | Array,
+ ...keys: Array
+ ) => ExpectChain,
+
+ throw: (
+ err?: Class | Error | RegExp | string,
+ errMsgMatcher?: RegExp | string,
+ msg?: string
+ ) => ExpectChain,
+
+ respondTo: (method: string) => ExpectChain,
+ itself: ExpectChain,
+
+ satisfy: (method: (value: T) => boolean) => ExpectChain,
+
+ closeTo: (expected: T & number, delta: number) => ExpectChain,
+
+ members: (set: mixed) => ExpectChain,
+ oneOf: (list: Array) => ExpectChain,
+
+ change: (obj: mixed, key: string) => ExpectChain,
+ increase: (obj: mixed, key: string) => ExpectChain,
+ decrease: (obj: mixed, key: string) => ExpectChain,
+
+ // dirty-chai
+ ok: () => ExpectChain,
+ true: () => ExpectChain,
+ false: () => ExpectChain,
+ null: () => ExpectChain,
+ undefined: () => ExpectChain,
+ exist: () => ExpectChain,
+ empty: () => ExpectChain,
+
+ extensible: () => ExpectChain,
+ sealed: () => ExpectChain,
+ frozen: () => ExpectChain,
+
+ // chai-immutable
+ size: (n: number) => ExpectChain,
+
+ // sinon-chai
+ called: () => ExpectChain,
+ callCount: (n: number) => ExpectChain,
+ calledOnce: () => ExpectChain,
+ calledTwice: () => ExpectChain,
+ calledThrice: () => ExpectChain,
+ calledBefore: (spy: mixed) => ExpectChain,
+ calledAfter: (spy: mixed) => ExpectChain,
+ calledWith: (...args: Array) => ExpectChain,
+ calledWithMatch: (...args: Array) => ExpectChain,
+ calledWithExactly: (...args: Array) => ExpectChain,
+
+ // chai-as-promised
+ eventually: ExpectChain,
+ resolvedWith: (value: mixed) => Promise & ExpectChain,
+ resolved: () => Promise & ExpectChain