walmartlabs / generator-thorax

Thorax yeoman generator
MIT License
87 stars 27 forks source link

Tests fail to run: 'ReferenceError: Can't find variable: global' #144

Closed ryankeener closed 10 years ago

ryankeener commented 10 years ago

I've been having trouble running the included tests and was wondering if I'm missing something. Here's what I've been doing:

> sudo npm install -g git+https://github.com/walmartlabs/generator-thorax.git
> yo thorax thorax-test
> cd thorax-test
> grunt test

which results in this:

connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
Running "ensure-installed" task

Running "jshint:app" (jshint) task
>> 8 files lint free.

Running "jshint:server" (jshint) task
>> 2 files lint free.

Running "karma:ci" (karma) task
INFO [karma]: Karma v0.10.9 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.2 (Mac OS X)]: Connected on socket PiQ5FW0sgmEBwaOG4paX
PhantomJS 1.9.2 (Mac OS X) ERROR
    ReferenceError: Can't find variable: global
    at /thorax-test/test/test-setup-all.js:18
PhantomJS 1.9.2 (Mac OS X): Executed 0 of 0 ERROR (0.127 secs / 0 secs)
Warning: Task "karma:ci" failed. Use --force to continue.

Aborted due to warnings.
neboleft commented 10 years ago

I had the same problem. I managed to work around it, but as I am not sure if it's a proper way to go, I didn't create a pull request. But I can share it as a patch file http://pastebin.com/a3MARjkn.

So, save the content of that as file (name it, let's say "thorax.patch"), and then in your desired-application directory (or whichever name you picked earlier):

patch -p0 < /path/to/thorax.patch

That should do it. grunt test runs fine now.

Of course, if the repo maintainers think that this is the way to go, I can create a pull request.

paera commented 10 years ago

I had the same issue and @mileticn your patch works for me.