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

Global leaks #99

Closed
ghost opened this issue Nov 30, 2011 · 5 comments
Closed

Global leaks #99

ghost opened this issue Nov 30, 2011 · 5 comments

Comments

@ghost
Copy link

ghost commented Nov 30, 2011

I am using YUI3 on node.js but I get this when running the test:

0) SDK should convert xml into json with yql
  1) SDK should convert xml into json with yql

  ✖ 2 of 2 tests failed:

  0) SDK should convert xml into json with yql:
     Error: global leaks detected: encoding, parseQueryString

  at Runner.checkGlobals (/usr/local/lib/node_modules/mocha/lib/runner.js:78:21)
      at Runner.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runner.js:40:44)
      at Runner.emit (events.js:88:20)
      at next (/usr/local/lib/node_modules/mocha/lib/runner.js:268:12)
      at /usr/local/lib/node_modules/mocha/lib/runner.js:291:25
      at done (/usr/local/lib/node_modules/mocha/lib/runnable.js:97:5)
      at Object.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runnable.js:80:7)
      at Timer.ontimeout (timers.js:84:39)

  1) SDK should convert xml into json with yql:
     Error: global leaks detected: encoding, parseQueryString

  at Runner.checkGlobals (/usr/local/lib/node_modules/mocha/lib/runner.js:78:21)
      at Runner.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runner.js:40:44)
      at Runner.emit (events.js:88:20)
      at next (/usr/local/lib/node_modules/mocha/lib/runner.js:268:12)
      at /usr/local/lib/node_modules/mocha/lib/runner.js:291:25
      at done (/usr/local/lib/node_modules/mocha/lib/runnable.js:97:5)
      at Object.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runnable.js:80:7)
      at Timer.ontimeout (timers.js:84:39)

It comes from Mocha. The YUI3 code doesn't run into any problem when I run it without Mocha.

YUI = require("yui3").YUI

YUI().use "yql", (Y) ->

  Y.YQL 'select title from rss where url="http://rss.news.yahoo.com/rss/topstories"', (r) ->
    console.log r

Any clue?

@tj
Copy link
Contributor

tj commented Nov 30, 2011

mocha definitely doesn't have these, I think what we should do is add --global name,name,name for accepted globals

@tj tj closed this as completed in a021710 Nov 30, 2011
@ghost
Copy link
Author

ghost commented Nov 30, 2011

Is there a way to add this in the test file directly so I don't have to run "mocha --globals encoding, parseQueryString" all the time at the console.

Also, could we just accept all global names as well?

@tj
Copy link
Contributor

tj commented Nov 30, 2011

use mocha.opts or a makefile

@ghost
Copy link
Author

ghost commented Nov 30, 2011

Worked great!

@quangv
Copy link

quangv commented Dec 1, 2011

awesome, was having this same problem just now... let's see if I know the name of what's leaking on purpose...

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

2 participants