Something broken in latest jsdom

已查看 30 次
跳至第一个未读帖子

Yash Ganthe

未读,
2014年6月20日 10:31:522014/6/20
收件人 js...@googlegroups.com
var jsdom = require("jsdom"); 
jsdom.env(
  function (errors, window) {
try{
    console.log( "%j", window.$("body"));
}
catch(e){
console.log("entering catch block");
  console.log(e);
  console.log("leaving catch block");
}

I see the following output...
entering catch block
[TypeError: Object #<DOMWindow> has no method '$']
leaving catch block

If I invoke the URL in a browser, it correctly shows HTML content. 
What I am doing wrong?

This was working fine in js...@0.10.5.  When I did npm install for latest jsdom, I saw the above behavior.

Regards,
Yash


回复全部
回复作者
转发
0 个新帖子