Skip to content

Commit

Permalink
Add TypeScript check for onNoMatch throwException
Browse files Browse the repository at this point in the history
  • Loading branch information
ctimmerm committed Oct 25, 2020
1 parent fd2f8bb commit bb405fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/promise.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("MockAdapter reply with Promise", function () {

it("rejects after Promise resolves to error response", function () {
mock.onGet("/bad/promise").reply(function () {
return new Promise(function (resolve, reject) {
return new Promise(function (resolve) {
resolve([400, { bad: "request" }]);
});
});
Expand Down
6 changes: 6 additions & 0 deletions types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ namespace AllowsConstructingWithOptions {
});
}

namespace SupportsOnNoMatchThrowException {
new MockAdapter(instance, {
onNoMatch: 'throwException'
});
}

namespace ExposesAdapter {
mock.adapter();
}
Expand Down

0 comments on commit bb405fd

Please sign in to comment.