mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
udpated compiled chai.js and added to browser tests
This commit is contained in:
parent
105fb02e98
commit
f64cb3ab0e
2 changed files with 16 additions and 1 deletions
16
chai.js
16
chai.js
|
@ -100,6 +100,20 @@ var AssertionError = require('./error')
|
|||
|
||||
module.exports = Assertion;
|
||||
|
||||
/**
|
||||
* # Assertion.includeStack
|
||||
*
|
||||
* Assertion.includeStack = true; // enable stack on error
|
||||
*
|
||||
* User configurable property, influences whether stack trace
|
||||
* is included in Assertion error message. Default of false
|
||||
* suppresses stack trace in the error message
|
||||
*
|
||||
* @api public
|
||||
*
|
||||
*/
|
||||
Assertion.includeStack = false;
|
||||
|
||||
/*!
|
||||
* # Assertion Constructor
|
||||
*
|
||||
|
@ -134,7 +148,7 @@ Assertion.prototype.assert = function (expr, msg, negateMsg) {
|
|||
throw new AssertionError({
|
||||
operator: this.msg,
|
||||
message: msg,
|
||||
stackStartFunction: this.ssfi
|
||||
stackStartFunction: (Assertion.includeStack) ? this.assert : this.ssfi
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<script src="../should.js"></script>
|
||||
<script src="../assert.js"></script>
|
||||
<script src="../plugins.js"></script>
|
||||
<script src="../assert-config.js"></script>
|
||||
<script>onload = function() {
|
||||
mocha.run();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue