Chai plugin to add also
property which accesses the original object
when using property
.
chai.use(require('chai-also'));
var blog = { title: 'JavaScript Ramblings' };
var article = { title: 'First Post', blog: blog };
blog.articles = [article];
article.should
.have.property('blog').that.has.property('title').that.is.a('string')
.and.also
.have.property('articles').that.is.an('array')
.and.also
.have.property('title').that.is.a('string');
This project is distributed under the MIT license.