Socket
Socket
Sign inDemoInstall

jest-mock-axios

Package Overview
Dependencies
300
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.7.0-beta3 to 4.7.0-beta4

35

dist/index.d.ts

@@ -0,1 +1,2 @@

import { jest } from '@jest/globals';
import { UnresolvedSynchronousPromise, SynchronousPromise } from 'synchronous-promise';

@@ -11,5 +12,5 @@

interface Interceptor {
use: jest.Mock<number, [onFulfilled?: (value: any) => any | Promise<any>, onRejected?: (error: any) => any]>;
eject: jest.Mock<void, [number]>;
clear: jest.Mock<void, []>;
use: jest.Mock<(onFulfilled?: (value: any) => any | Promise<any>, onRejected?: (error: any) => any) => number>;
eject: jest.Mock<(index: number) => void>;
clear: jest.Mock<() => void>;
}

@@ -23,13 +24,15 @@ interface Interceptors {

}
type MockUnresolvedPromise = (url?: string, options?: any) => UnresolvedSynchronousPromise<any>;
type MockUnresolvedPromiseBody = (url?: string, body?: any, options?: any) => UnresolvedSynchronousPromise<any>;
interface AxiosAPI {
get: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?]>;
post: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?, any?]>;
put: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?, any?]>;
patch: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?, any?]>;
delete: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?]>;
head: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?]>;
options: jest.Mock<UnresolvedSynchronousPromise<any>, [string?, any?]>;
request: jest.Mock<UnresolvedSynchronousPromise<any>, [any?]>;
all: jest.Mock<Promise<any>, [any]>;
create: jest.Mock<AxiosMockType, []>;
get: jest.Mock<MockUnresolvedPromise>;
post: jest.Mock<MockUnresolvedPromiseBody>;
put: jest.Mock<MockUnresolvedPromiseBody>;
patch: jest.Mock<MockUnresolvedPromiseBody>;
delete: jest.Mock<MockUnresolvedPromise>;
head: jest.Mock<MockUnresolvedPromise>;
options: jest.Mock<MockUnresolvedPromise>;
request: jest.Mock<(options?: any) => UnresolvedSynchronousPromise<any>>;
all: jest.Mock<(promises: any) => Promise<any>>;
create: jest.Mock<() => AxiosMockType>;
interceptors: Interceptors;

@@ -42,3 +45,3 @@ defaults: AxiosDefaults;

}
declare type CancelStatic = new (message?: string) => Cancel;
type CancelStatic = new (message?: string) => Cancel;
interface CancelToken {

@@ -49,3 +52,3 @@ promise: Promise<Cancel>;

}
declare type Canceler = (message?: string) => void;
type Canceler = (message?: string) => void;
interface CancelTokenSource {

@@ -175,3 +178,3 @@ token: CancelToken;

*/
declare type AxiosMockType = AxiosAPI & AxiosMockAPI & jest.Mock<UnresolvedSynchronousPromise<any>, [any?]>;
type AxiosMockType = AxiosAPI & AxiosMockAPI & jest.Mock<(options?: any) => any>;

@@ -178,0 +181,0 @@ /**

var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __export = (target, all) => {

@@ -109,8 +126,7 @@ for (var name in all)

const conf = data && config ? config : {};
return _newReq({
...conf,
return _newReq(__spreadProps(__spreadValues({}, conf), {
data,
method,
url
});
}));
};

@@ -157,3 +173,9 @@ var _helperReqNoData = (method, url, config) => {

headers: {
common: []
common: [],
get: {},
post: {},
delete: {},
put: {},
patch: {},
head: {}
}

@@ -160,0 +182,0 @@ };

{
"name": "jest-mock-axios",
"version": "4.7.0-beta3",
"version": "4.7.0-beta4",
"description": "Axios mock for Jest",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc