mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add to the chai Assert interface (#18835)
* Add to the chai Assert interface * Fix one-line missing whitespace
This commit is contained in:
committed by
Mohamed Hegazy
parent
bb4aa71df3
commit
be920333eb
2
types/chai-http/index.d.ts
vendored
2
types/chai-http/index.d.ts
vendored
@@ -62,7 +62,7 @@ declare global {
|
||||
end(callback?: (err: any, res: Response) => void): FinishedRequest;
|
||||
}
|
||||
|
||||
interface FinishedRequest<T = Response>{
|
||||
interface FinishedRequest<T = Response> {
|
||||
then<TR1 = T, TR2 = void>(success?: (res: T) => TR1 | PromiseLike<TR1>, failure?: (err: any) => TR2 | PromiseLike<TR2>): FinishedRequest<TR1>;
|
||||
catch(failure?: (err: any) => void): FinishedRequest<T>;
|
||||
}
|
||||
|
||||
12
types/chai/index.d.ts
vendored
12
types/chai/index.d.ts
vendored
@@ -1338,6 +1338,18 @@ declare namespace Chai {
|
||||
*/
|
||||
notFrozen<T>(object: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that the target does not contain any values. For arrays and
|
||||
* strings, it checks the length property. For Map and Set instances, it
|
||||
* checks the size property. For non-function objects, it gets the count
|
||||
* of own enumerable string keys.
|
||||
*
|
||||
* @type T Type of object
|
||||
* @param object Actual value.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
isEmpty<T>(object: T, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that the target contains values. For arrays and strings, it checks
|
||||
* the length property. For Map and Set instances, it checks the size property.
|
||||
|
||||
Reference in New Issue
Block a user