From 791befe2d799cc5fa5954d5df768d7348e523a23 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Wed, 14 Sep 2016 22:34:39 -0300 Subject: [PATCH] Add toJSON to proxyExcludedKeys 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 `` --- lib/chai/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chai/config.js b/lib/chai/config.js index 9c8be3cff..ca1e30a79 100644 --- a/lib/chai/config.js +++ b/lib/chai/config.js @@ -90,5 +90,5 @@ module.exports = { * @api public */ - proxyExcludedKeys: ['then', 'inspect'] + proxyExcludedKeys: ['then', 'inspect', 'toJSON'] };