Skip to content

Commit

Permalink
Add toJSON to proxyExcludedKeys
Browse files Browse the repository at this point in the history
Hello there,

While I was working on #799, I discovered that you cannot call `JSON.stringify` on an assertion because o proxify.

```javascript
const { expect } = require('chai');

const equal = expect(1).to.equal(1);
JSON.stringify(equal); // This will throw Error: Invalid Chai property: toJSON
``
  • Loading branch information
vieiralucas committed Sep 15, 2016
1 parent c9cb468 commit 791befe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chai/config.js
Expand Up @@ -90,5 +90,5 @@ module.exports = {
* @api public
*/

proxyExcludedKeys: ['then', 'inspect']
proxyExcludedKeys: ['then', 'inspect', 'toJSON']
};

0 comments on commit 791befe

Please sign in to comment.