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

chai-spies-next

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-spies-next - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

19

chai-spies.js

@@ -61,3 +61,3 @@ !function (context, definition) {

* const [push, pop] = spy.on(array, ['push', 'pop']);
*
*
* spy.on(array, 'push', returns => 1)

@@ -240,3 +240,3 @@ *

};
proxy.__spy = {

@@ -248,2 +248,17 @@ calls: []

/**
* # proxy.reset (function)
*
* Resets spy's state object parameters for instantiation and reuse
* @returns proxy spy object
*/
proxy.reset = function() {
this.__spy = {
calls: []
, called: false
, name: name
};
return this;
}
return proxy;

@@ -250,0 +265,0 @@ }

@@ -45,3 +45,3 @@ /*!

* const [push, pop] = spy.on(array, ['push', 'pop']);
*
*
* spy.on(array, 'push', returns => 1)

@@ -224,3 +224,3 @@ *

};
proxy.__spy = {

@@ -232,2 +232,17 @@ calls: []

/**
* # proxy.reset (function)
*
* Resets spy's state object parameters for instantiation and reuse
* @returns proxy spy object
*/
proxy.reset = function() {
this.__spy = {
calls: []
, called: false
, name: name
};
return this;
}
return proxy;

@@ -234,0 +249,0 @@ }

2

package.json

@@ -15,3 +15,3 @@ {

],
"version": "0.9.1",
"version": "0.9.2",
"license": "MIT",

@@ -18,0 +18,0 @@ "repository": {

@@ -504,2 +504,32 @@ if (!chai) {

describe('reset method', function () {
it('should reset spy object values to defaults when called', function() {
var name = 'proxy';
var spy = chai.spy(name);
spy();
spy.should.have.been.called();
spy.__spy.called.should.be.true;
spy.__spy.calls.should.have.length(1);
spy.__spy.name.should.be.equal(name);
spy.reset();
spy.should.not.have.been.called();
spy.__spy.called.should.be.false;
spy.__spy.calls.should.have.length(0);
spy.__spy.name.should.be.equal(name);
});
it('should setup spy with default values when spy is instantiated', function() {
var name = 'proxy';
var spy = chai.spy(name);
spy.should.be.spy;
spy.__spy.called.should.be.false;
spy.__spy.calls.should.have.length(0);
spy.__spy.name.should.be.equal(name);
});
});
describe('spy restore', function () {

@@ -506,0 +536,0 @@ var array;

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