Skip to content

Commit bb405fd

Browse files
committed
Add TypeScript check for onNoMatch throwException
1 parent fd2f8bb commit bb405fd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/promise.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("MockAdapter reply with Promise", function () {
3232

3333
it("rejects after Promise resolves to error response", function () {
3434
mock.onGet("/bad/promise").reply(function () {
35-
return new Promise(function (resolve, reject) {
35+
return new Promise(function (resolve) {
3636
resolve([400, { bad: "request" }]);
3737
});
3838
});

types/test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ namespace AllowsConstructingWithOptions {
1515
});
1616
}
1717

18+
namespace SupportsOnNoMatchThrowException {
19+
new MockAdapter(instance, {
20+
onNoMatch: 'throwException'
21+
});
22+
}
23+
1824
namespace ExposesAdapter {
1925
mock.adapter();
2026
}

0 commit comments

Comments
 (0)