qunitjs/node-qunit

No output when running qunit

Closed this issue · 3 comments

Something is causing a failure when I try to run qunit -c ./dist/all.js -t ./test.js

I stripped down my "all.js" to this:

var fabric = { };

fabric.document = require("jsdom").jsdom("<!DOCTYPE html><html><head></head><body></body></html>");
fabric.window = fabric.document.createWindow();

fabric.foo = function() { fabric };

and "test.js" only has this:

QUnit.module('test');

test('foo', function() {
  equal('foo', 'foo2');
});

This is what I get when running the above command (note that there's no output):

> qunit -c ./dist/all.js -t ./test.js

Testing /Users/kangax/dev/fabric.js/dist/all.js ... %

Any idea what's happening? It's interesting how this last line fabric.foo = function() { fabric } makes it "choke", but for example, fabric.foo = function() { } or var foo = function() { fabric } are just fine.

FWIW:

> npm -v
1.1.23
> node -v
0.6.18
> qunit -v
0.5.7
kof commented

just done what you described, works fine, installed:

macos 10.7.4
jsdom 0.2.15
npm -v
1.1.21
node -v
v0.6.18
qunit -v
0.5.7

Is it really that last line or jsdom?

kof commented

That last line can't be the problem ...

Yeah that last line is pretty bizarre but removing it was actually making output appear! Either removing last line of 2 jsdom-related lines...

I just updated jsdom to 0.2.15 (had 0.2.14) and it started working. Curiously, it was still failing when json2.js was included, but updating it to latest version (the one from 2011; i had the one from 2010) made it work. Go figure.