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

chai

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai - npm Package Compare versions

Comparing version 1.8.1 to 1.9.0

CONTRIBUTING.md

2

bower.json
{
"name": "chai"
, "version": "1.8.1"
, "version": "1.9.0"
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."

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

1.9.0 / 2014-01-29
==================
* docs: add contributing.md #238
* assert: .throws() returns thrown error. Closes #185
* Merge pull request #232 from laconbass/assert-throws
* assert: .fail() parameter mismatch. Closes #206
* Merge branch 'karma-fixes'
* Add karma phantomjs launcher
* Use latest karma and sauce launcher
* Karma tweaks
* Merge pull request #230 from jkroso/include
* Merge pull request #237 from chaijs/coverage
* Add coverage to npmignore
* Remove lib-cov from test-travisci dependents
* Remove the not longer needed lcov reporter
* Test coverage with istanbul
* Remove jscoverage
* Remove coveralls
* Merge pull request #226 from duncanbeevers/add_has
* Avoid error instantiation if possible on assert.throws
* Merge pull request #231 from duncanbeevers/update_copyright_year
* Update Copyright notices to 2014
* handle negation correctly
* add failing test case
* support `{a:1,b:2}.should.include({a:1})`
* Merge pull request #224 from vbardales/master
* Add `has` to language chains
* Merge pull request #219 from demands/overwrite_chainable
* return error on throw method to chain on error properties, possibly different from message
* util: store chainable behavior in a __methods object on ctx
* util: code style fix
* util: add overwriteChainableMethod utility (for #215)
* Merge pull request #217 from demands/test_cleanup
* test: make it possible to run utilities tests with --watch
* makefile: change location of karma-runner bin script
* Merge pull request #202 from andreineculau/patch-2
* test: add tests for throwing custom errors
* Merge pull request #201 from andreineculau/patch-1
* test: updated for the new assertion errors
* core: improve message for assertion errors (throw assertion)
1.8.1 / 2013-10-10

@@ -3,0 +45,0 @@ ==================

module.exports = function(config) {
config.set({
basePath: ''
, frameworks: [ 'mocha' ]
frameworks: [ 'mocha' ]
, files: [

@@ -10,5 +9,3 @@ 'build/build.js'

]
, exclude: []
, reporters: [ 'progress' ]
, port: 9876
, colors: true

@@ -18,3 +15,5 @@ , logLevel: config.LOG_INFO

, browsers: [ 'PhantomJS' ]
, captureTimeout: 60000
, browserDisconnectTimeout: 10000
, browserDisconnectTolerance: 2
, browserNoActivityTimeout: 20000
, singleRun: true

@@ -21,0 +20,0 @@ });

/*!
* chai
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* chai
* http://chaijs.com
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -84,2 +84,6 @@ */

Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
};
/*!

@@ -86,0 +90,0 @@ * ### .assert(expression, message, negateMessage, expected, actual)

/*!
* chai
* http://chaijs.com
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -16,3 +16,3 @@ */

*
* The following are provide as chainable getters to
* The following are provided as chainable getters to
* improve the readability of your assertions. They

@@ -30,2 +30,3 @@ * do not provide an testing capability unless they

* - and
* - has
* - have

@@ -42,3 +43,3 @@ * - with

[ 'to', 'be', 'been'
, 'is', 'and', 'have'
, 'is', 'and', 'has', 'have'
, 'with', 'that', 'at'

@@ -151,5 +152,17 @@ , 'of', 'same' ].forEach(function (chain) {

if (msg) flag(this, 'message', msg);
var obj = flag(this, 'object')
var obj = flag(this, 'object');
if (_.type(val) === 'object') {
if (!flag(this, 'negate')) {
for (var k in val) new Assertion(obj).property(k, val[k]);
return;
}
var subset = {}
for (var k in val) subset[k] = obj[k]
var expected = _.eql(subset, val);
} else {
var expected = obj && ~obj.indexOf(val)
}
this.assert(
~obj.indexOf(val)
expected
, 'expected #{this} to include ' + _.inspect(val)

@@ -1009,2 +1022,3 @@ , 'expected #{this} to not include ' + _.inspect(val));

* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
* @returns error for chaining (null if no error)
* @api public

@@ -1034,3 +1048,6 @@ */

} else if (typeof constructor === 'function') {
name = (new constructor()).name;
name = constructor.prototype.name || constructor.name;
if (name === 'Error' && constructor !== Error) {
name = (new constructor()).name;
}
} else {

@@ -1049,8 +1066,10 @@ constructor = null;

, 'expected #{this} to not throw #{exp}'
, desiredError
, err
, (desiredError instanceof Error ? desiredError.toString() : desiredError)
, (err instanceof Error ? err.toString() : err)
);
flag(this, 'object', err);
return this;
}
// next, check constructor

@@ -1063,7 +1082,11 @@ if (constructor) {

, name
, err
, (err instanceof Error ? err.toString() : err)
);
if (!errMsg) return this;
if (!errMsg) {
flag(this, 'object', err);
return this;
}
}
// next, check message

@@ -1083,2 +1106,3 @@ var message = 'object' === _.type(err) && "message" in err

flag(this, 'object', err);
return this;

@@ -1094,2 +1118,3 @@ } else if ((message != null) && errMsg && 'string' === typeof errMsg) {

flag(this, 'object', err);
return this;

@@ -1117,5 +1142,7 @@ } else {

, 'expected #{this} to not throw ' + expectedThrown + actuallyGot
, desiredError
, thrownError
, (desiredError instanceof Error ? desiredError.toString() : desiredError)
, (thrownError instanceof Error ? thrownError.toString() : thrownError)
);
flag(this, 'object', thrownError);
};

@@ -1122,0 +1149,0 @@

/*!
* chai
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -58,9 +58,8 @@ */

assert.fail = function (actual, expected, message, operator) {
throw new chai.AssertionError({
message = message || 'assert.fail()';
throw new chai.AssertionError(message, {
actual: actual
, expected: expected
, message: message
, operator: operator
, stackStartFunction: assert.fail
});
}, assert.fail);
};

@@ -661,15 +660,3 @@

assert.include = function (exp, inc, msg) {
var obj = new Assertion(exp, msg);
if (Array.isArray(exp)) {
obj.to.include(inc);
} else if ('string' === typeof exp) {
obj.to.contain.string(inc);
} else {
throw new chai.AssertionError(
'expected an array or string'
, null
, assert.include
);
}
new Assertion(exp, msg).include(inc);
};

@@ -694,15 +681,3 @@

assert.notInclude = function (exp, inc, msg) {
var obj = new Assertion(exp, msg);
if (Array.isArray(exp)) {
obj.to.not.include(inc);
} else if ('string' === typeof exp) {
obj.to.not.contain.string(inc);
} else {
throw new chai.AssertionError(
'expected an array or string'
, null
, assert.notInclude
);
}
new Assertion(exp, msg).not.include(inc);
};

@@ -951,3 +926,4 @@

new Assertion(fn, msg).to.Throw(errt, errs);
var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
return flag(assertErr, 'object');
};

@@ -954,0 +930,0 @@

/*!
* chai
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* chai
* Copyright(c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - addChainingMethod utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -58,11 +58,23 @@ */

module.exports = function (ctx, name, method, chainingBehavior) {
if (typeof chainingBehavior !== 'function')
if (typeof chainingBehavior !== 'function') {
chainingBehavior = function () { };
}
var chainableBehavior = {
method: method
, chainingBehavior: chainingBehavior
};
// save the methods so we can overwrite them later, if we need to.
if (!ctx.__methods) {
ctx.__methods = {};
}
ctx.__methods[name] = chainableBehavior;
Object.defineProperty(ctx, name,
{ get: function () {
chainingBehavior.call(this);
chainableBehavior.chainingBehavior.call(this);
var assert = function () {
var result = method.apply(this, arguments);
var result = chainableBehavior.method.apply(this, arguments);
return result === undefined ? this : result;

@@ -69,0 +81,0 @@ };

/*!
* Chai - addMethod utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - addProperty utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - flag utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - getActual utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - getEnumerableProperties utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - message composition utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - getName utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - getPathValue utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* @see https://github.com/logicalparadox/filtr

@@ -5,0 +5,0 @@ * MIT Licensed

/*!
* Chai - getProperties utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

@@ -109,1 +109,7 @@ /*!

/*!
* Overwrite chainable method
*/
exports.overwriteChainableMethod = require('./overwriteChainableMethod');
/*!
* Chai - flag utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - overwriteMethod utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - overwriteProperty utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - test utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - transferFlags utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

/*!
* Chai - type utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed

@@ -5,0 +5,0 @@ */

@@ -14,3 +14,3 @@ {

],
"version": "1.8.1",
"version": "1.9.0",
"repository": {

@@ -36,10 +36,9 @@ "type": "git",

"component": "*"
, "coveralls": "2.0.16"
, "jscoverage": "0.3.7"
, "karma": "canary"
, "karma": "0.11.12"
, "karma-mocha": "*"
, "karma-sauce-launcher": "git://github.com/embarkmobile/karma-sauce-launcher.git#feature-passfail"
, "karma-sauce-launcher": "0.2.0"
, "karma-phantomjs-launcher": "0.1.1"
, "mocha": "1.8.2"
, "mocha-lcov-reporter": "0.0.1"
, "istanbul": "~0.1.44"
}
}

@@ -8,3 +8,3 @@ [![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com)

[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai) [![Coverage Status](https://coveralls.io/repos/chaijs/chai/badge.png?branch=master)](https://coveralls.io/r/chaijs/chai?branch=master)
[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai)

@@ -16,43 +16,50 @@ [![Selenium Test Status](https://saucelabs.com/browser-matrix/chaijs.svg)](https://saucelabs.com/u/chaijs)

- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing.
- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
### Contributors
project : chai
repo age : 1 year, 9 months
active : 139 days
commits : 693
files : 54
authors :
518 Jake Luer 74.7%
66 Veselin Todorov 9.5%
43 Domenic Denicola 6.2%
6 Ruben Verborgh 0.9%
5 George Kats 0.7%
5 Jo Liss 0.7%
5 Juliusz Gonera 0.7%
5 Scott Nonnenberg 0.7%
4 John Firebaugh 0.6%
4 Nick Heiner 0.6%
4 josher19 0.6%
3 Jeff Barczewski 0.4%
3 Ryunosuke SATO 0.4%
2 Bartvds 0.3%
2 Edwin Shao 0.3%
2 Jakub Nešetřil 0.3%
2 Teddy Cross 0.3%
1 Anand Patil 0.1%
1 Benjamin Horsleben 0.1%
1 Brandon Payton 0.1%
1 Chris Connelly 0.1%
1 Chun-Yi 0.1%
1 DD 0.1%
1 Jeff Welch 0.1%
1 Kilian Ciuffolo 0.1%
1 Niklas Närhinen 0.1%
1 Paul Miller 0.1%
1 Sasha Koss 0.1%
1 Victor Costan 0.1%
1 Vinay Pulim 0.1%
1 piecioshka 0.1%
project : chai
repo age : 2 years, 2 months ago
commits : 735
active : 158 days
files : 56
authors :
532 Jake Luer 72.4%
79 Veselin Todorov 10.7%
43 Domenic Denicola 5.9%
6 Ruben Verborgh 0.8%
5 George Kats 0.7%
5 Jo Liss 0.7%
5 Juliusz Gonera 0.7%
5 Scott Nonnenberg 0.7%
4 John Firebaugh 0.5%
4 Max Edmands 0.5%
4 Nick Heiner 0.5%
4 josher19 0.5%
3 Andrei Neculau 0.4%
3 Jake Rosoman 0.4%
3 Jeff Barczewski 0.4%
3 Ryunosuke SATO 0.4%
2 Bartvds 0.3%
2 Duncan Beevers 0.3%
2 Edwin Shao 0.3%
2 Jakub Nešetřil 0.3%
2 Teddy Cross 0.3%
1 Anand Patil 0.1%
1 Benjamin Horsleben 0.1%
1 Brandon Payton 0.1%
1 Chris Connelly 0.1%
1 Chun-Yi 0.1%
1 DD 0.1%
1 Jeff Welch 0.1%
1 Kilian Ciuffolo 0.1%
1 Niklas Närhinen 0.1%
1 Paul Miller 0.1%
1 Sasha Koss 0.1%
1 Veselin 0.1%
1 Victor Costan 0.1%
1 Vinay Pulim 0.1%
1 Virginie BARDALES 0.1%
1 laconbass 0.1%
1 piecioshka 0.1%

@@ -63,3 +70,3 @@ ## License

Copyright (c) 2011-2013 Jake Luer <jake@alogicalparadox.com>
Copyright (c) 2011-2014 Jake Luer <jake@alogicalparadox.com>

@@ -66,0 +73,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

# Release Notes
## 1.9.0 / 2014-01-29
The following changes are required if you are upgrading from the previous version:
- **Users:**
- No changes required
- **Plugin Developers:**
- Review [#219](https://github.com/chaijs/chai/pull/219).
- **Core Contributors:**
- Refresh `node_modules` folder for updated dependencies.
### Community Contributions
- [#202](https://github.com/chaijs/chai/pull/201) Improve error message for .throw(). [@andreineculau](https://github.com/andreineculau)
- [#217](https://github.com/chaijs/chai/pull/217) Chai tests can be run with `--watch`. [@demands](https://github.com/demands)
- [#219](https://github.com/chaijs/chai/pull/219) Add overwriteChainableMethod utility. [@demands](https://github.com/demands)
- [#224](https://github.com/chaijs/chai/pull/224) Return error on throw method to chain on error properties. [@vbardales](https://github.com/vbardales)
- [#226](https://github.com/chaijs/chai/pull/226) Add `has` to language chains. [@duncanbeevers](https://github.com/duncanbeevers)
- [#230](https://github.com/chaijs/chai/pull/230) Support `{a:1,b:2}.should.include({a:1})` [@jkroso](https://github.com/jkroso)
- [#231](https://github.com/chaijs/chai/pull/231) Update Copyright notices to 2014 [@duncanbeevers](https://github.com/duncanbeevers)
- [#232](https://github.com/chaijs/chai/pull/232) Avoid error instantiation if possible on assert.throws. [@laconbass](https://github.com/laconbass)
Thank you to all who took time to contribute!
### Other Bug Fixes
- [#225](https://github.com/chaijs/chai/pull/225) Improved AMD wrapper provided by upstream `component(1)`.
- [#185](https://github.com/chaijs/chai/issues/185) `assert.throws()` returns thrown error for further assertions.
- [#237](https://github.com/chaijs/chai/pull/237) Remove coveralls/jscoverage, include istanbul coverage report in travis test.
- Update Karma and Sauce runner versions for consistent CI results. No more karma@canary.
## 1.8.1 / 2013-10-10

@@ -4,0 +35,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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