Add type definitions for code expectation

This commit is contained in:
Mark Wubben 2018-05-30 17:50:05 +01:00
parent ad2d96de0b
commit b91f7e0da8
2 changed files with 6 additions and 0 deletions

3
index.d.ts vendored
View file

@ -6,6 +6,9 @@ export type Constructor = (new (...args: Array<any>) => any);
/** Specify one or more expectations the thrown error must satisfy. */
export type ThrowsExpectation = {
/** The thrown error must have a code that equals the given string. */
code?: string;
/** The thrown error must be an instance of this constructor. */
instanceOf?: Constructor;

View file

@ -14,6 +14,9 @@ export type Constructor = Class<{constructor(...args: Array<any>): any}>;
/** Specify one or more expectations the thrown error must satisfy. */
export type ThrowsExpectation = {
/** The thrown error must have a code that equals the given string. */
code?: string;
/** The thrown error must be an instance of this constructor. */
instanceOf?: Constructor;