chai
Version:
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
20 lines (17 loc) • 452 B
JavaScript
/*!
* Chai - getActual utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed
*/
/**
* # getActual(object, [actual])
*
* Returns the `actual` value for an Assertion
*
* @param {Object} object (constructed Assertion)
* @param {Arguments} chai.Assertion.prototype.assert arguments
*/
module.exports = function (obj, args) {
var actual = args[4];
return 'undefined' !== typeof actual ? actual : obj._obj;
};