Skip to content

Commit

Permalink
Merge pull request #922 from meeber/remove-chai-frames
Browse files Browse the repository at this point in the history
Remove implementation frames from stack trace
  • Loading branch information
keithamus committed Apr 4, 2017
2 parents ef2bf66 + a253b4c commit e5ac3b0
Show file tree
Hide file tree
Showing 17 changed files with 735 additions and 319 deletions.
12 changes: 10 additions & 2 deletions lib/chai/assertion.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ module.exports = function (_chai, util) {
* in environments that support `Error.captureStackTrace`, and only when
* `Chai.config.includeStack` hasn't been set to `false`.
*
* - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
* should retain its current value, even as assertions are chained off of
* this object. This is usually set to `true` when creating a new assertion
* from within another assertion. It's also temporarily set to `true` before
* an overwritten assertion gets called by the overwriting assertion.
*
* @param {Mixed} obj target of the assertion
* @param {String} msg (optional) custom error message
* @param {Function} stack (optional) starting point for removing stack frames
* @param {Function} ssfi (optional) starting point for removing stack frames
* @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked
* @api private
*/

function Assertion (obj, msg, ssfi) {
function Assertion (obj, msg, ssfi, lockSsfi) {
flag(this, 'ssfi', ssfi || Assertion);
flag(this, 'lockSsfi', lockSsfi);
flag(this, 'object', obj);
flag(this, 'message', msg);

Expand Down

0 comments on commit e5ac3b0

Please sign in to comment.