Skip to content

wbyoung/chai-also

Repository files navigation

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.

About

Access the original Chai subject after using property

Resources

License

Stars

Watchers

Forks

Packages

No packages published