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.4.2 to 3.4.3

2

es/executor.js

@@ -132,3 +132,3 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

if (mock.allowCallThrough || mock.matchOrigin) {
if (mock.allowCallThrough || mock.matchOrigin || mock.mockThrough) {
if (!mock.original) {

@@ -135,0 +135,0 @@ mock.original = originalLoader(request, parent, isMain);

@@ -49,2 +49,18 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

/**
* Enable automatic dependency mocking
* @name ModuleMock.mockThrough
* @param {Function} [mockFactory=sinon.stub] - mock constructor
* @return {ModuleMock}
*/
}, {
key: 'mockThrough',
value: function mockThrough() {
var mockFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
this.mock.mockThrough = mockFactory;
return this;
}
/**
* Setting es6 behavior for a current module

@@ -51,0 +67,0 @@ * @return {ModuleMock}

@@ -157,3 +157,3 @@ 'use strict';

if (mock.allowCallThrough || mock.matchOrigin) {
if (mock.allowCallThrough || mock.matchOrigin || mock.mockThrough) {
if (!mock.original) {

@@ -160,0 +160,0 @@ mock.original = (0, _module.originalLoader)(request, parent, isMain);

@@ -60,2 +60,18 @@ 'use strict';

/**
* Enable automatic dependency mocking
* @name ModuleMock.mockThrough
* @param {Function} [mockFactory=sinon.stub] - mock constructor
* @return {ModuleMock}
*/
}, {
key: 'mockThrough',
value: function mockThrough() {
var mockFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
this.mock.mockThrough = mockFactory;
return this;
}
/**
* Setting es6 behavior for a current module

@@ -62,0 +78,0 @@ * @return {ModuleMock}

{
"name": "rewiremock",
"version": "3.4.2",
"description": "Easy and es6 compatible dependency mocking tool.",
"version": "3.4.3",
"description": "Advanced dependency mocking device.",
"main": "lib/index.js",

@@ -23,2 +23,10 @@ "jsnext:main": "es/index.js",

},
"repository": {
"type": "git",
"url": "git+https://github.com/theKashey/rewiremock.git"
},
"bugs": {
"url": "https://github.com/theKashey/rewiremock/issues"
},
"homepage": "https://github.com/theKashey/rewiremock#readme",
"files": [

@@ -42,3 +50,4 @@ "lib",

"mock",
"stub"
"mockery",
"proxyquire"
],

@@ -45,0 +54,0 @@ "jest": {

@@ -6,8 +6,8 @@ # rewiremock [![Build Status](https://secure.travis-ci.org/theKashey/rewiremock.svg)](http://travis-ci.org/theKashey/rewiremock)

Simple es6-friendly mocking library inspired by the best libraries:
- [mockery](https://github.com/mfncooper/mockery) - the library I like the most.
- [mock-require](https://github.com/boblauer/mock-require) - the simplest thing ever.
- [proxyquire](https://github.com/theKashey/proxyquire) - the one I know better than others.
- [mockery](https://github.com/mfncooper/mockery) - the library I like the most. Rewiremock is a better mockery.
- [proxyquire](https://github.com/theKashey/proxyquire) - the one with quite handy API. Rewiremock do it better.
- [mock-require](https://github.com/boblauer/mock-require) - the simplest thing ever. Things must not be complex.
By its nature rewiremock has same behavior as Mockery. But it can behave like others too.
It covers _any_ cases. It is the right way to mock your dependencies or perform dependency injection.
It covers _any_ case. It is the right way to mock your dependencies or perform dependency injection.

@@ -71,3 +71,3 @@

#Usage
# Usage
```js

@@ -74,0 +74,0 @@ // 1. proxy will load a file by it's own ( keep in mind - name resolution is a complex thing)

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