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

should

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

should - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

12

examples/runner.js

@@ -53,2 +53,14 @@

test('Math#sin()', function(){
Math.sin(12).should.be.approximately(-0.5365, 1e-3);
});
test('Math#cos()', function(){
Math.cos(0).should.not.be.approximately(10, 1e-3);
});
test('Math#log()', function(){
Math.log(10).should.be.approximately(10, 1e-3);
});
console.log();
1.2.0 / 2012-09-21
==================
* Added #approximately(value, delta, description) for doing assertions on results of operations with numbers. [titarenko]
1.1.1 / 2012-09-19

@@ -3,0 +8,0 @@ ==================

25

lib/should.js

@@ -110,7 +110,6 @@ /*!

* @param {Object} expected
* @param {String} type
* @api private
*/
assert: function(expr, msg, negatedMsg, expected, type){
assert: function(expr, msg, negatedMsg, expected, showDiff){
var msg = this.negate ? negatedMsg : msg

@@ -122,3 +121,3 @@ , ok = this.negate ? !expr : expr

throw new AssertionError({
var err = new AssertionError({
message: msg.call(this)

@@ -129,4 +128,7 @@ , actual: obj

, negated: this.negate
, type: type
});
err.showDiff = showDiff;
throw err;
},

@@ -291,3 +293,3 @@

, val
, 'equal');
, true);
return this;

@@ -332,2 +334,15 @@ },

/**
* Assert within value +- delta (inclusive).
*
* @param {Number} value
* @param {Number} delta
* @param {String} description
* @api public
*/
approximately: function(value, delta, description) {
return this.within(value - delta, value + delta, description);
},
/**
* Assert typeof.

@@ -334,0 +349,0 @@ *

2

package.json
{ "name": "should"
, "description": "test framework agnostic BDD-style assertions"
, "version": "1.1.1"
, "version": "1.2.0"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "repository": { "type": "git", "url": "git://github.com/visionmedia/should.js.git" }

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