0.1.0 • Published 9 years ago

chai-also v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Chai-Also

NPM version Build status Code Climate Coverage Status Dependencies devDependencies

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');

License

This project is distributed under the MIT license.