Socket
Socket
Sign inDemoInstall

chai-spies

Package Overview
Dependencies
0
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.7.0

20

chai-spies.js

@@ -90,9 +90,19 @@ !function (context, definition) {

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

@@ -99,0 +109,0 @@

{
"name": "chai-spies",
"repo": "chaijs/chai-spies",
"version": "0.6.0",
"version": "0.7.0",
"description": "Spies for the Chai assertion library.",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -0,1 +1,8 @@

### Note
As of 0.6.0, the History.md file has been deprecated. [Please refer to the full
commit logs available on GitHub](https://github.com/chaijs/chai-spies/commits/master).
---
0.6.0 / 2015-04-24

@@ -2,0 +9,0 @@ ==================

@@ -74,9 +74,19 @@ /*!

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

@@ -83,0 +93,0 @@

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

"description": "Spies for the Chai assertion library.",
"version": "0.6.0",
"version": "0.7.0",
"repository": {

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

# Release Notes
## Note
As of 0.6.0, the ReleaseNotes.md file has been deprecated. [Please refer to the release notes available on Github](https://github.com/chaijs/chai-spies/releases).
---
## 0.6.0 / 2015-04-24

@@ -4,0 +9,0 @@

@@ -404,2 +404,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);
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc