gemini-testing / gemini-gui

GUI for gemini
MIT License
69 stars 18 forks source link

Added safe stringifying for circular JSON #14

Closed twolfson closed 9 years ago

twolfson commented 9 years ago

When passing a callback to suite.capture, the data being sent becomes circular (i.e. there is a reference to itself within the JSON).

// Works
suite.capture('plain');

// Errors out
suite.capture('plain', function (actions) {
  action.setWindowSize(1024, 768);
});  

Unfortunately, this was a hard bug to track down as gemini-gui would silently exit rather than give me a stack trace =/

After adding a console.log to here, I found the error and patched it with json-stringify-safe:

https://github.com/gemini-testing/gemini/blob/6499b54110bc197f3262d26e9be0c90fec6dc94e/lib/runner.js#L72-L75

In this PR:

SevInf commented 9 years ago

Thanks!

SevInf commented 9 years ago

Published in 0.2.3