Open
Description
openedon Nov 25, 2016
Just spent way too long getting this bug and not knowing why. After figuring it out, here's the simplest repro I could make
it('Mocha is confused', function(done) {
new Promise(function(resolve, reject) {
var a = {};
a.b = a;
resolve(a);
}).then(done).catch(done);
});
Produces
1) Mocha is confused
0 passing (20ms)
1 failing
1) Mocha is confused:
TypeError: Converting circular structure to JSON
at Object.stringify (native)
The problem here is that there isn't a stack-trace, so I start off with absolutely no idea how to solve the problem. I have no idea why Mocha wants to stringify what I give to the done
function, but it does...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment