29 lines
540 B
Plaintext
29 lines
540 B
Plaintext
|
/*!
|
||
|
* Chai - test utility
|
||
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||
|
* MIT Licensed
|
||
|
*/
|
||
|
|
||
|
/*!
|
||
|
* Module dependencies
|
||
|
*/
|
||
|
|
||
|
var flag = require('./flag');
|
||
|
|
||
|
/**
|
||
|
* ### .test(object, expression)
|
||
|
*
|
||
|
* Test an object for expression.
|
||
|
*
|
||
|
* @param {Object} object (constructed Assertion)
|
||
|
* @param {Arguments} chai.Assertion.prototype.assert arguments
|
||
|
* @namespace Utils
|
||
|
* @name test
|
||
|
*/
|
||
|
|
||
|
module.exports = function test(obj, args) {
|
||
|
var negate = flag(obj, 'negate')
|
||
|
, expr = args[0];
|
||
|
return negate ? !expr : expr;
|
||
|
};
|