Require jQuery on headless environment

133 views
Skip to first unread message

Oswaldo Ferreira

unread,
Apr 10, 2015, 9:45:29 PM4/10/15
to jasmi...@googlegroups.com
I started on Jasmine a few minutes ago and opted on going through "npm install -g jasmine" path. I'm trying to load JQuery on support/jasmine.json and on Spec files (i've managed a dependencies/jquery.js path) but still can't use jQuery syntax on tests. 

"ReferenceError: $ is not defined"

Someone can tell me the best way on handling those kind of dependencies (like jQuery)? 

Thanks!

Greg Cobb

unread,
Apr 10, 2015, 10:09:36 PM4/10/15
to jasmi...@googlegroups.com
I believe the Jasmine NPM only executes specs in Node. If you are writing browser javascript and want to run it in a headless browser (phantom), you can use tools like Jasmine Gem or Jasmine Py.

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.

Gregg Van Hove

unread,
Apr 10, 2015, 10:14:54 PM4/10/15
to jasmi...@googlegroups.com
If you want to run browser based specs in a node environment, you can also look at gulp-jasmine-browser or grunt-contrib-jasmine 
Reply all
Reply to author
Forward
0 new messages