debitoor / chai-subset

"containSubset" object properties matcher for Chai
http://chaijs.com/plugins/chai-subset/
MIT License
82 stars 20 forks source link

Circular Reference #1

Closed jrnewell closed 9 years ago

jrnewell commented 10 years ago

This plugin will fail if the object contains a circular reference despite it not being part of the subSet assertion.

This is due to the use of JSON.stringify for creating the assertion message. Maybe the plugin should use https://github.com/WebReflection/circular-json or https://github.com/isaacs/json-stringify-safe instead?

eagleeye commented 10 years ago

Great suggestion, @jrnewell. Will take a look at it in a nearest time!