Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Added safe stringifying for circular JSON #14

Conversation

twolfson
Copy link
Contributor

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:

  • Added fix for circular JSON by using json-stringify-safe
  • Added regression test to prevent the issue from recurring

SevInf pushed a commit that referenced this pull request Jun 15, 2015
…back.sqwished

Added safe stringifying for circular JSON
@SevInf SevInf merged commit 5e5461b into gemini-testing:master Jun 15, 2015
@SevInf
Copy link
Contributor

SevInf commented Jun 15, 2015

Thanks!

@SevInf
Copy link
Contributor

SevInf commented Jun 15, 2015

Published in 0.2.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants