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

muk

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

muk - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

5

lib/method.js

@@ -26,5 +26,6 @@ // keep track of mocks

method.restore = function restoreMocks() {
mocks.forEach(function(m) {
for (var i = mocks.length - 1; i >= 0; i--) {
var m = mocks[i];
m.obj[m.key] = m.original;
});
}
mocks = [];

@@ -31,0 +32,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"keywords": ["test", "mock", "dependency"],
"version": "0.3.0",
"version": "0.3.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

# muk [![Build Status](https://secure.travis-ci.org/fent/node-muk.png)](http://travis-ci.org/fent/node-muk)
![muk](http://cdn.bulbagarden.net/upload/7/7c/089Muk.png)
![muk](http://www.pokemonelite2000.com/sprites/bwb/89.png)

@@ -5,0 +5,0 @@

@@ -45,2 +45,10 @@ var muk = require('..');

assert.equal(fs.mkdir, mkdir, 'original method is restored');
var readFileMock = function(path, callback) {
process.nextTick(callback.bind(null, null, 'hello!'));
};
muk(fs, 'readFile', readFileMock);
muk(fs, 'readFile', readFileMock);
muk.restore();
assert.equal(fs.readFile, readFile, 'mock twices, original method should be restored too');
});

@@ -67,2 +75,12 @@ });

});
it('Should have original properties after muk.restore()', function () {
muk(config, 'enableCache', false);
muk(config, 'enableCache', false);
muk(config, 'delay', 0);
muk.restore();
assert.equal(config.enableCache, true, 'enableCache is true');
assert.equal(config.delay, 10, 'delay is 10');
});
});
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