Merge pull request #9763 from kidmillions/patch-1

Add .isAtMost() .isAtLeast() to chai.assert defin.
This commit is contained in:
Mohamed Hegazy
2016-06-21 21:08:53 -07:00
committed by GitHub
2 changed files with 21 additions and 0 deletions
+18
View File
@@ -1930,6 +1930,24 @@ suite('assert', () => {
}, 'expected 5 to be below 5');
});
test('isAtLeast', () => {
assert.isAtLeast(5, 3);
assert.isAtLeast(5, 5);
err(() => {
assert.isAtLeast(3, 5);
}, 'expected 3 to be greater than or equal to 5');
});
test('isAtMost', () => {
assert.isAtMost(3, 5);
assert.isAtMost(5, 5);
err(() => {
assert.isAtMost(5, 3);
}, 'expected 5 to be less than or equal to 3');
});
test('extensible', () => { assert.extensible({}); });
test('isExtensible', () => { assert.isExtensible({}); });
test('notExtensible', () => { assert.notExtensible(Object.preventExtensions({})); });
+3
View File
@@ -271,6 +271,9 @@ declare namespace Chai {
isAbove(val: number, abv: number, msg?: string): void;
isBelow(val: number, blw: number, msg?: string): void;
isAtMost(val: number, atmst: number, msg?: string): void;
isAtLeast(val: number, atlst: number, msg?: string): void;
isFunction(val: any, msg?: string): void;
isNotFunction(val: any, msg?: string): void;