Skip to content

Commit

Permalink
documented fail methods for expect and should interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Zamojc committed Feb 10, 2015
1 parent c2f9e43 commit ffd7c19
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/chai/interface/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ module.exports = function (chai, util) {
return new chai.Assertion(val, message);
};

/**
* ### .fail(actual, expected, [message], [operator])
*
* Throw a failure.
*
* @name fail
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @param {String} operator
* @api public
*/

chai.expect.fail = function (actual, expected, message, operator) {
message = message || 'expect.fail()';
throw new chai.AssertionError(message, {
Expand Down
13 changes: 13 additions & 0 deletions lib/chai/interface/should.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ module.exports = function (chai, util) {

var should = {};

/**
* ### .fail(actual, expected, [message], [operator])
*
* Throw a failure.
*
* @name fail
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @param {String} operator
* @api public
*/

should.fail = function (actual, expected, message, operator) {
message = message || 'should.fail()';
throw new chai.AssertionError(message, {
Expand Down

0 comments on commit ffd7c19

Please sign in to comment.