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

deride

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deride - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

6

lib/deride.js

@@ -88,2 +88,7 @@ /*

function reset() {
timesCalled = 0;
calledWithArgs = {};
}
function call() {

@@ -99,2 +104,3 @@ calledWithArgs[timesCalled++] = arguments;

twice: calledTwice,
reset: reset,
withArgs: withArgs

@@ -101,0 +107,0 @@ },

2

package.json
{
"name": "deride",
"description": "Mocking library based on composition",
"version": "0.1.13",
"version": "0.1.14",
"homepage": "https://github.com/REAANDREW/deride",

@@ -6,0 +6,0 @@ "author": {

@@ -35,2 +35,5 @@ # deride [![Build Status](https://travis-ci.org/REAANDREW/deride.svg?branch=master)](https://travis-ci.org/REAANDREW/deride) [![NPM version](https://badge.fury.io/js/deride.svg)](http://badge.fury.io/js/deride) [![Dependency Status](https://david-dm.org/REAANDREW/deride.svg)](https://david-dm.org/REAANDREW/deride)

### Resetting the counts / called with args
- ```obj```.expect.```method```.called.reset()
### Setup

@@ -37,0 +40,0 @@

@@ -107,2 +107,33 @@ /*

describe('Single function', function() {
it('Resetting the called count', function(done) {
var MyClass = function() {
return {
doStuff: function() {}
};
};
var myClass = deride.wrap(new MyClass());
myClass.doStuff();
myClass.expect.doStuff.called.once();
myClass.expect.doStuff.called.reset();
myClass.expect.doStuff.called.never();
done();
});
it('Resetting the called with count', function(done) {
var MyClass = function() {
return {
doStuff: function() {}
};
};
var myClass = deride.wrap(new MyClass());
myClass.doStuff('test');
myClass.expect.doStuff.called.withArgs('test');
myClass.expect.doStuff.called.reset();
/* jshint immed: false */
(function() {
myClass.expect.doStuff.called.withArgs('test');
}).should.throw('false == true');
done();
});
it('can setup a return value', function(done) {

@@ -109,0 +140,0 @@ var func = deride.func();

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