Skip to content

Commit b91f7e0

Browse files
committed
Add type definitions for code expectation
1 parent ad2d96d commit b91f7e0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export type Constructor = (new (...args: Array<any>) => any);
66

77
/** Specify one or more expectations the thrown error must satisfy. */
88
export type ThrowsExpectation = {
9+
/** The thrown error must have a code that equals the given string. */
10+
code?: string;
11+
912
/** The thrown error must be an instance of this constructor. */
1013
instanceOf?: Constructor;
1114

index.js.flow

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export type Constructor = Class<{constructor(...args: Array<any>): any}>;
1414

1515
/** Specify one or more expectations the thrown error must satisfy. */
1616
export type ThrowsExpectation = {
17+
/** The thrown error must have a code that equals the given string. */
18+
code?: string;
19+
1720
/** The thrown error must be an instance of this constructor. */
1821
instanceOf?: Constructor;
1922

0 commit comments

Comments
 (0)