Skip to content

Commit

Permalink
Add types for static default property
Browse files Browse the repository at this point in the history
Closes #371
  • Loading branch information
remcohaszing authored and marcbachmann committed Jun 14, 2023
1 parent 32074d6 commit 84436c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type RequestMatcherFunc = (
) => MockAdapter.RequestHandler;

declare class MockAdapter {
static default: typeof MockAdapter;

constructor(axiosInstance: AxiosInstance, options?: MockAdapterOptions);

adapter(): AxiosAdapter;
Expand Down
3 changes: 2 additions & 1 deletion types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import axios from 'axios';
import MockAdapter = require('axios-mock-adapter');

const instance = axios.create();
const mock = new MockAdapter(instance);
let mock = new MockAdapter(instance);
mock = new MockAdapter.default(instance)

namespace AllowsConstructing {
new MockAdapter(instance);
Expand Down

0 comments on commit 84436c0

Please sign in to comment.