mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
To handle Promise type correctly, the result must be a PromisedAssertion like as chai-as-promised
30 lines
802 B
TypeScript
30 lines
802 B
TypeScript
// Type definitions for dirty-chai 2.0
|
|
// Project: https://github.com/prodatakey/dirty-chai
|
|
// Definitions by: Piotr Roszatycki <https://github.com/dex4er>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 3.0
|
|
|
|
/// <reference types="chai" />
|
|
/// <reference types="chai-as-promised" />
|
|
|
|
declare global {
|
|
namespace Chai {
|
|
interface LanguageChains {
|
|
always: Assertion;
|
|
}
|
|
|
|
interface Assertion {
|
|
(message?: string): Assertion;
|
|
ensure: Assertion;
|
|
}
|
|
|
|
interface PromisedAssertion extends Eventually, PromiseLike<any> {
|
|
(message?: string): PromisedAssertion;
|
|
ensure: PromisedAssertion;
|
|
}
|
|
}
|
|
}
|
|
|
|
declare const dirtyChai: Chai.ChaiPlugin;
|
|
export = dirtyChai;
|