rewiremock
Advanced tools
Comparing version 3.13.4 to 3.13.5
{ | ||
"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; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
185063
84
4025