Update should.js types for version 11

This commit is contained in:
Lukas Spieß
2017-08-16 17:03:21 +02:00
parent 2209c748ea
commit f536cc503e
2 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
// Type definitions for should.js v8.3.0
// Type definitions for should.js v11.2.0
// Project: https://github.com/shouldjs/should.js
// Definitions by: Alex Varju <https://github.com/varju/>, Maxime LUCE <https://github.com/SomaticIT/>
// Definitions by: Alex Varju <https://github.com/varju/>, Maxime LUCE <https://github.com/SomaticIT/>, Lukas Spieß <https://github.com/lumaxis/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Object {
@@ -88,6 +88,8 @@ interface ShouldAssertion {
keys(...allKeys: string[]): ShouldAssertion;
keys(allKeys: string[]): ShouldAssertion;
enumerable(property: string, value?: any): ShouldAssertion;
size(size: number): ShouldAssertion;
value(key: string | number, value: any): ShouldAssertion;
enumerables(...properties: string[]): ShouldAssertion;
startWith(expected: string, message?: any): ShouldAssertion;
endWith(expected: string, message?: any): ShouldAssertion;

View File

@@ -264,6 +264,11 @@ obj.should.have.keys('foo', 'bar');
obj.should.have.keys(['foo', 'bar']);
obj.should.have.key('foo');
({ a: 10 }).should.have.size(1);
({ a: 10 }).should.have.value('a', 10);
({ a: 10 }).should.have.value(1, 2);
({ a: 10 }).should.have.enumerable('a');
({ a: 10 }).should.have.enumerable('a', 10);
({ a: 10, b: 10 }).should.have.enumerables('a', 'b');