Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rewiremock

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rewiremock - npm Package Compare versions

Comparing version 3.13.4 to 3.13.5

node.d.ts

4

package.json
{
"name": "rewiremock",
"version": "3.13.4",
"version": "3.13.5",
"description": "Advanced dependency mocking device.",

@@ -40,3 +40,5 @@ "main": "lib/index.js",

"node.js",
"node.d.ts",
"webpack.js",
"webpack.d.ts",
"internal.js",

@@ -43,0 +45,0 @@ "babel.js"

@@ -7,3 +7,3 @@ declare module 'rewiremock' {

[Key in PluginNames]: any
};
};

@@ -20,2 +20,5 @@ interface OverloadedModule {

/**
* Base non-strict module interface
*/
interface BaseMock {

@@ -104,2 +107,5 @@ /**

/**
* Typed mock interface
*/
interface NamedModuleMock<T> extends BaseMock {

@@ -126,2 +132,5 @@ /**

/**
* Module with default export mock interface
*/
interface DefaultModuleMock<T extends HasDefault> extends NamedModuleMock<T> {

@@ -134,3 +143,6 @@ /**

interface AnyModuleMock {
/**
* Non-strict mock interface
*/
interface AnyModuleMock extends BaseMock {
/**

@@ -164,6 +176,18 @@ * Setting es6 behavior for a current module and overriding default export

interface rewiremock {
/**
* Define an overload for a given module
* @param {String} module
*/
(module: string): ModuleMock;
<T extends HasDefault>(module: ImportFunction<T>): DefaultModuleMock<T>
<T>(module: ImportFunction<T>): NamedModuleMock<T>
/**
* Define an overload for a given module with default export
* @param {Function} module
*/
<T extends HasDefault>(module: ImportFunction<T>): DefaultModuleMock<T>
/**
* Define an overload for a given module using import or require function
* @param {Function} module
*/
<T>(module: ImportFunction<T>): NamedModuleMock<T>

@@ -178,4 +202,10 @@ /**

/**
* Enables rewiremock and prepares module system (cleans cache)
*/
enable(): rewiremock;
/**
* Disables rewiremock and cleans cache
*/
disable(): rewiremock;

@@ -267,8 +297,38 @@

var rewiremockdefault: rewiremock;
/**
* rewiremock main export
* @example
* rewiremock('module').with({});
* rewiremock.enable();
*/
export default rewiremockdefault;
/**
* Adds a plugin
* @param plugin
*/
export function addPlugin(plugin:Plugin):void;
/**
* Removes a plugin
* @param plugin
*/
export function removePlugins(plugin:Plugin):void;
/**
* Sets given module as a top level parent
* @param module
*/
export function overrideEntryPoint(module:any):void;
/**
* Configures extensions to handle
* @param extensions
*/
export function resolveExtensions(extensions: string[]):void;
/**
* List of available plugins
*/
export var plugins: Plugins;
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc