Skip to content

Commit

Permalink
fix: wrong assertion types
Browse files Browse the repository at this point in the history
`.change`, `.increase`, and `.decrease` were wrongly categorized as
chainable method assertions. They don't have any chaining behavior,
and there's no generic semantic benefit to chaining them. This commit
recategorizes them as method assertions.
  • Loading branch information
meeber committed Jan 30, 2017
1 parent 576a6f7 commit d75c6c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/chai/core/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2083,8 +2083,8 @@ module.exports = function (chai, _) {
);
}

Assertion.addChainableMethod('change', assertChanges);
Assertion.addChainableMethod('changes', assertChanges);
Assertion.addMethod('change', assertChanges);
Assertion.addMethod('changes', assertChanges);

/**
* ### .increase(target[, property[, message]])
Expand Down Expand Up @@ -2147,8 +2147,8 @@ module.exports = function (chai, _) {
);
}

Assertion.addChainableMethod('increase', assertIncreases);
Assertion.addChainableMethod('increases', assertIncreases);
Assertion.addMethod('increase', assertIncreases);
Assertion.addMethod('increases', assertIncreases);

/**
* ### .decrease(target[, property[, message]])
Expand Down Expand Up @@ -2211,8 +2211,8 @@ module.exports = function (chai, _) {
);
}

Assertion.addChainableMethod('decrease', assertDecreases);
Assertion.addChainableMethod('decreases', assertDecreases);
Assertion.addMethod('decrease', assertDecreases);
Assertion.addMethod('decreases', assertDecreases);

/**
* ### .by
Expand Down

0 comments on commit d75c6c7

Please sign in to comment.