Merge pull request #7137 from MrHen/feature/should

Add containDeepOrdered to shouldjs
This commit is contained in:
Masahiro Wakame
2015-12-12 23:21:26 +09:00
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -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]}});
+1
View File
@@ -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;