Skip to content

Commit

Permalink
test cases for fix chaijs#1043
Browse files Browse the repository at this point in the history
  • Loading branch information
solodynamo committed Sep 10, 2017
1 parent 3f2ce29 commit 335fd33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/expect.js
Expand Up @@ -1462,6 +1462,14 @@ describe('expect', function () {
err(function () {
expect(undefined, 'blah').to.have.property("a");
}, "blah: Target cannot be null or undefined.");

expect(function () {
expect({a:1}).to.have.nested.property('{a:1}');
}).to.not.throw('the argument to `property` must be a string');

expect(function () {
expect({a:1}).to.have.nested.property({'a':'1'});
}).to.throw('the argument to `property` must be a string');
});

it('property(name, val)', function(){
Expand Down
2 changes: 2 additions & 0 deletions test/should.js
Expand Up @@ -1407,6 +1407,8 @@ describe('should', function() {

({ 'foo.bar[]': 'baz'}).should.have.nested.property('foo\\.bar\\[\\]');

({a:1}).should.have.nested.property('a');

err(function(){
({ 'foo.bar': 'baz' }).should.have.nested.property('foo.bar');
}, "expected { 'foo.bar': 'baz' } to have nested property 'foo.bar'");
Expand Down

0 comments on commit 335fd33

Please sign in to comment.