运行JasmineHeadlessWebkit时找不到变量

运行JasmineHeadlessWebkit时找不到变量

本文介绍了ReferenceError:运行JasmineHeadlessWebkit时找不到变量:$的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图找到一个答案,至少在最后两个小时没有运气。

I've been trying to find an answer to this at least for the last two hours without any luck. I hope someone here might be able to help.

我得到这个之前提到 helpers / code>但是这似乎没有真正的区别。

I have jQuery in specs/javascripts/helpers/ and in jasmine.yml i'm mentioning the helpers before the spec_files and src_files but that doesn't seem to really make a difference.

所以,如果有人有任何想法,如何我可以确保jQuery是完全加载当Jasmine的规范运行时,我非常感谢任何帮助。

So, if anyone has any idea how I can make sure that jQuery is completely loaded when Jasmine's specs are run, I would really appreciate any help.

此外,如果您需要任何其他信息,请告诉我。

Also, please let me know if you need any additional information.

谢谢。

推荐答案

我也遇到了这个问题。我修改它通过更改我的jasmine.yml加载jquery之前,它加载的其余的javascript文件:

I ran into this problem also. I fixed it by changing my jasmine.yml to load jquery before it loads the rest of the javascript files:

src_files:
  - public/js/jquery.js
  - public/js/**/*.js

这篇关于ReferenceError:运行JasmineHeadlessWebkit时找不到变量:$的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 22:10