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 0.5.1 to 0.6.0

6

History.md
0.6.0 / 2012-03-01
==================
* Added `err.actual` and `err.expected` for .{eql,equal}()
* Added 'return this;' to 'get json' and 'get html' in order to provide chaining for should.be.json and should.be.html
0.5.1 / 2012-01-13

@@ -3,0 +9,0 @@ ==================

16

lib/should.js

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

exports.version = '0.5.1';
exports.version = '0.6.0';

@@ -116,11 +116,15 @@ /**

* @param {String} negatedMsg
* @param {Object} expected
* @api private
*/
assert: function(expr, msg, negatedMsg){
assert: function(expr, msg, negatedMsg, expected){
var msg = this.negate ? negatedMsg : msg
, ok = this.negate ? !expr : expr;
if (!ok) {
throw new AssertionError({
message: msg
, actual: this.obj
, expected: expected
, stackStartFunction: this.assert

@@ -286,3 +290,4 @@ });

, 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "")
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : ""));
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "")
, val);
return this;

@@ -303,3 +308,4 @@ },

, 'expected ' + this.inspect + ' to equal ' + i(val) + (desc ? " | " + desc : "")
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : ""));
, 'expected ' + this.inspect + ' to not equal ' + i(val) + (desc ? " | " + desc : "")
, val);
return this;

@@ -623,2 +629,3 @@ },

this.obj.headers['content-type'].should.include('application/json');
return this;
},

@@ -637,2 +644,3 @@

this.obj.headers['content-type'].should.include('text/html');
return this;
},

@@ -639,0 +647,0 @@

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

@@ -5,0 +5,0 @@ , "contributors": [ "Aseem Kishore <aseem.kishore@gmail.com>" ]

@@ -6,3 +6,4 @@

var should = require('../');
var should = require('../')
, assert = require('assert');

@@ -66,3 +67,12 @@ function err(fn, msg) {

},
'test .expected and .actual': function(){
try {
'foo'.should.equal('bar');
} catch (err) {
assert('foo' == err.actual, 'err.actual');
assert('bar' == err.expected, 'err.expected');
}
},
'test arguments': function(){

@@ -69,0 +79,0 @@ var args = (function(){ return arguments; })(1,2,3);

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