getActual.js 415 B

123456789101112131415161718
  1. /*!
  2. * Chai - getActual utility
  3. * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
  4. * MIT Licensed
  5. */
  6. /**
  7. * # getActual(object, [actual])
  8. *
  9. * Returns the `actual` value for an Assertion
  10. *
  11. * @param {Object} object (constructed Assertion)
  12. * @param {Arguments} chai.Assertion.prototype.assert arguments
  13. */
  14. module.exports = function (obj, args) {
  15. return args.length > 4 ? args[4] : obj._obj;
  16. };