I have seen many other answers on this site but none of them worked for me.
The problem: I need to load jQuery with an URL, not with a local path; and I think I can't add thoose to "files" on karma.conf.js.
Everything seems to be fine, but when I try to use karma to test it, it returns: Uncaught ReferenceError: $ is not defined.
The order of the scripts is fine in the two .html we use.
I have seen many other answers on this site but none of them worked for me.
The problem: I need to load jQuery with an URL, not with a local path; and I think I can't add thoose to "files" on karma.conf.js.
Everything seems to be fine, but when I try to use karma to test it, it returns: Uncaught ReferenceError: $ is not defined.
The order of the scripts is fine in the two .html we use.
Share Improve this question asked Mar 10, 2015 at 20:12 dquijadadquijada 1,6993 gold badges14 silver badges19 bronze badges 5 |1 Answer
Reset to default 30Simple include the jQuery path in the karma.conf.js
(as for Karma 0.12 at least):
module.exports = function(config) {
config.set({
files: [
'https://code.jquery.com/jquery-1.11.2.min.js'
...
],
...
});
};
I've tested it yesterday because I needed a similar thing for AngularJS.
ptor.sleep(2000)
before/in your test blocks – Christopher Marshall Commented Mar 10, 2015 at 20:18files
block in yourkarma.config.js
(unsure) stackoverflow.com/questions/20938320/… – Christopher Marshall Commented Mar 10, 2015 at 20:56