axios-mock-adapter
- Version 2.1.0
- Published
- 67.9 kB
- 2 dependencies
- MIT license
Install
npm i axios-mock-adapter
yarn add axios-mock-adapter
pnpm add axios-mock-adapter
Overview
Axios adapter that allows to easily mock requests
Index
Classes
Interfaces
Classes
class MockAdapter
class MockAdapter {}
constructor
constructor(axiosInstance: AxiosInstance, options?: MockAdapterOptions);
property default
static default: typeof MockAdapter;
property history
history: AxiosRequestConfig[] & Record<verb, AxiosRequestConfig[]>;
property onAny
onAny: NoBodyRequestMatcherFunc;
property onDelete
onDelete: NoBodyRequestMatcherFunc;
property onGet
onGet: NoBodyRequestMatcherFunc;
property onHead
onHead: NoBodyRequestMatcherFunc;
property onLink
onLink: RequestMatcherFunc;
property onList
onList: RequestMatcherFunc;
property onOptions
onOptions: NoBodyRequestMatcherFunc;
property onPatch
onPatch: RequestMatcherFunc;
property onPost
onPost: RequestMatcherFunc;
property onPut
onPut: RequestMatcherFunc;
property onUnlink
onUnlink: RequestMatcherFunc;
method adapter
adapter: () => AxiosAdapter;
method reset
reset: () => void;
method resetHandlers
resetHandlers: () => void;
method resetHistory
resetHistory: () => void;
method restore
restore: () => void;
Interfaces
interface RequestHandler
interface RequestHandler {}
property reply
reply: ResponseSpecFunc;
property replyOnce
replyOnce: ResponseSpecFunc;
method abortRequest
abortRequest: () => MockAdapter;
method abortRequestOnce
abortRequestOnce: () => MockAdapter;
method networkError
networkError: () => MockAdapter;
method networkErrorOnce
networkErrorOnce: () => MockAdapter;
method passThrough
passThrough: () => MockAdapter;
method timeout
timeout: () => MockAdapter;
method timeoutOnce
timeoutOnce: () => MockAdapter;
method withDelayInMs
withDelayInMs: (delay: number) => RequestHandler;
Package Files (1)
Dependencies (2)
Dev Dependencies (8)
Peer Dependencies (1)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/axios-mock-adapter
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/axios-mock-adapter)
- HTML<a href="https://www.jsdocs.io/package/axios-mock-adapter"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2930 ms. - Missing or incorrect documentation? Open an issue for this package.