Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Growl reporter fails due to recursive structure #823

Closed
fb55 opened this issue Apr 22, 2013 · 6 comments
Closed

Growl reporter fails due to recursive structure #823

fb55 opened this issue Apr 22, 2013 · 6 comments

Comments

@fb55
Copy link

fb55 commented Apr 22, 2013

Hi,

I'm using mocha for CSSselect and for some reason, the growl reporter doesn't work.

The project uses the exports style.

feedy:CSSselect felix$ mocha -R growl --watch


/usr/local/share/npm/lib/node_modules/mocha/node_modules/growl/lib/growl.js:197
      args.push(quote(msg));
                ^
TypeError: Converting circular structure to JSON
    at stringify (native)
    at new growl (/usr/local/share/npm/lib/node_modules/mocha/node_modules/growl/lib/growl.js:197:17)
    at Mocha.run (/usr/local/share/npm/lib/node_modules/mocha/lib/mocha.js:309:18)
    at loadAndRun (/usr/local/share/npm/lib/node_modules/mocha/bin/_mocha:300:11)
    at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/mocha/bin/_mocha:311:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

One fix would be to use util.inspect instead of JSON.stringify in node-growl.

@tj
Copy link
Contributor

tj commented Apr 24, 2013

hmm not sure what's going on there

@fb55
Copy link
Author

fb55 commented Apr 25, 2013

For some reason, mocha ends up with a recursive structure. You can run the tests yourself, have a look at the link.

@tj
Copy link
Contributor

tj commented Apr 25, 2013

don't have time to look into it right now but I'll try soon

@AvnerCohen
Copy link

@fb55 I suspect the problem is simply wrong execution of the growl "repoter"

feedy:CSSselect felix$ mocha -R growl --watch

Should be

feedy:CSSselect felix$ mocha --growl --watch

I do agree however that the API to growl should probably be a reporter just like any other...

@park9140
Copy link
Contributor

park9140 commented Aug 4, 2013

Funny story I had the same thought on growl needing to be its own reporter the other day, in context to having multiple reporters.

#930

@fb55
Copy link
Author

fb55 commented Aug 10, 2013

And that worked! Thanks, now I have a much better reason than pretty logs to use mocha :)

@fb55 fb55 closed this as completed Aug 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants