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

prunk

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prunk - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

21

index.js

@@ -124,4 +124,4 @@ //

// ## Exports
module.exports = {
// ## The prunk object
var prunk = {

@@ -158,4 +158,6 @@ // Provide access to the cache.

//
// It returns the prunk object so that you can chain calls.
mock: function(test, value) {
createMock(test, value, 'mock');
return prunk;
},

@@ -168,4 +170,6 @@

//
// It returns the prunk object so that you can chain calls.
suppress: function(test) {
createMock(test, void 0, 'sup');
return prunk;
},

@@ -177,4 +181,6 @@

// mocks.
// It returns the prunk object so that you can chain calls.
unmock: function(test) {
remove(test, 'mock');
return prunk;
},

@@ -186,4 +192,6 @@

// imports.
// It returns the prunk object so that you can chain calls.
unsuppress: function(test) {
remove(test, 'sup');
return prunk;
},

@@ -193,4 +201,6 @@

// Removes all mocks for imports
// It returns the prunk object so that you can chain calls.
unmockAll: function() {
removeAll('mock');
return prunk;
},

@@ -200,6 +210,11 @@

// Removes all suppressed imports
// It returns the prunk object so that you can chain calls.
unsuppressAll: function() {
removeAll('sup');
return prunk;
}
};
};
// ## Exports
module.exports = prunk;

2

package.json
{
"name": "prunk",
"version": "1.0.0",
"version": "1.1.0",
"description": "A mocking utility for node.js require",

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

@@ -74,4 +74,6 @@ # prunk

var mockStyles = (req) => 'style.css' === req;
prunk.mock( mockStyles, 'no css, dude.');
```javascript
var mockStyles = (req) => 'style.css' === req;
prunk.mock( mockStyles, 'no css, dude.');
```

@@ -82,6 +84,15 @@ `test` can also be a `RegExp` that is matched agains the name

prunk.mock( 'style.css', 'no css, dude.' );
prunk.mock( /\.(css|scss|sass|less)/, 'no styles, dude.');
```javascript
prunk.mock( 'style.css', 'no css, dude.' );
prunk.mock( /\.(css|scss|sass|less)/, 'no styles, dude.');
```
This function returns the prunk object so that you can chain calls.
```javascript
prunk.mock( ... )
.mock( ... )
.mock( ... );
```
### prunk.unmock(test)

@@ -93,5 +104,8 @@

This function returns the prunk object so that you can chain calls.
### prunk.unmockAll()
Removes all mocks
Removes all mocks.
This function returns the prunk object so that you can chain calls.

@@ -109,4 +123,6 @@ ### prunk.suppress(test)

var mockStyles = (req) => 'style.css' === req;
prunk.mock( mockStyles, 'no css, dude.');
```javascript
var mockStyles = (req) => 'style.css' === req;
prunk.mock( mockStyles, 'no css, dude.');
```

@@ -116,5 +132,9 @@ `test` can also be a `RegExp` that is matched agains the name

prunk.mock( 'style.css', 'no css, dude.' );
prunk.mock( /\.(css|scss|sass|less)/, 'no styles, dude.');
```javascript
prunk.mock( 'style.css', 'no css, dude.' );
prunk.mock( /\.(css|scss|sass|less)/, 'no styles, dude.');
```
This function returns the prunk object so that you can chain calls.
### prunk.unsuppress(test)

@@ -125,6 +145,8 @@

imports.
This function returns the prunk object so that you can chain calls.
### prunk.unsuppressAll()
Removes all suppressed imports
Removes all suppressed imports.
This function returns the prunk object so that you can chain calls.

@@ -131,0 +153,0 @@ ## Documentation

@@ -92,2 +92,6 @@ /**

it('should return the prunk object again', function() {
expect( prunk.mock() ).to.equal( prunk );
});
});

@@ -145,2 +149,6 @@

});
it('should return the prunk object again', function() {
expect( prunk.unmock() ).to.equal( prunk );
});
});

@@ -202,2 +210,6 @@

});
it('should return the prunk object again', function() {
expect( prunk.unmockAll() ).to.equal( prunk );
});
});

@@ -253,2 +265,6 @@

});
it('should return the prunk object again', function() {
expect( prunk.suppress() ).to.equal( prunk );
});
});

@@ -305,2 +321,6 @@

});
it('should return the prunk object again', function() {
expect( prunk.unsuppress() ).to.equal( prunk );
});
});

@@ -362,2 +382,6 @@

});
it('should return the prunk object again', function() {
expect( prunk.unsuppressAll() ).to.equal( prunk );
});
});
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