Skip to content

Commit

Permalink
fix: add timeout value to error details in rejectAfterTimeout (#715)
Browse files Browse the repository at this point in the history
* fix: add timeout value to error details in rejectAfterTimeout

* Update callApiAndParseWithTimeout.test.ts
  • Loading branch information
Erik Ritter authored and zhaoyongjie committed Nov 26, 2021
1 parent bd83ba4 commit c244286
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default function rejectAfterTimeout<T>(timeout: number) {
reject({
error: 'Request timed out',
statusText: 'timeout',
timeout,
}),
timeout,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ describe('callApiAndParseWithTimeout()', () => {
expect(error).toEqual({
error: 'Request timed out',
statusText: 'timeout',
timeout: 1,
});
}
});
Expand Down

0 comments on commit c244286

Please sign in to comment.