chai-public-equal
"publicEqual" is an object properties matcher for Chai assertion library
This plugin use https://www.npmjs.com/package/deep-equal to check equality. Before compare it removes the private properties based on the given patterns. The default pattern is /^_.+/
Installation
npm install --save-dev chai-public-equal
Usage
var chai = ;var chaiPublicEqual = ;chai;
Public Equal check
in your spec.js
var obj = a: 'b' c: 'd' _d: 'private_value' e: f: 1 _g: 2 ; to;//or with 'not'tonot;
Contain publics check
in your spec.js
var obj = a: 'b' c: 'd' _d: 'private_value'; to; //or with 'not'tonot;
Custom patterns for public property name checking
chai.use(chaiPublicEqual([/^_.+/, /^should/]));