diff --git a/should/should-tests.ts b/should/should-tests.ts index c940f7c13..43b21d0ef 100644 --- a/should/should-tests.ts +++ b/should/should-tests.ts @@ -172,3 +172,10 @@ obj.should.have.keys('foo', 'bar'); obj.should.have.keys(['foo', 'bar']); (1).should.eql(0, 'some useful description'); + +[ 1, 2, 3].should.containDeepOrdered([1, 2]); +[ 1, 2, [ 1, 2, 3 ]].should.containDeepOrdered([ 1, [ 2, 3 ]]); + +({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({a: 10}); +({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({b: {c: 10}}); +({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({b: {d: [1, 3]}}); diff --git a/should/should.d.ts b/should/should.d.ts index ba32f571b..26a42d7ed 100644 --- a/should/should.d.ts +++ b/should/should.d.ts @@ -64,6 +64,7 @@ interface ShouldAssertion { contain(obj: any): ShouldAssertion; containEql(obj: any): ShouldAssertion; containDeep(obj: any): ShouldAssertion; + containDeepOrdered(obj: any): ShouldAssertion; keys(...allKeys: string[]): ShouldAssertion; keys(allKeys: string[]): ShouldAssertion; header(field: string, val?: string): ShouldAssertion;