看到这个问题,但重命名为jQuery
无济于事。
我正在尝试在 Webstorm 中进行一些基本的单元测试。即使没有测试,它也找不到其他文件中定义的东西。
我有这个配置文件:
server: http://localhost:9876
load:
- libs/jquery-1.9.0.min.js
- src/jquery.combine/jquery.combine.js
但是在运行测试时会出现此错误:
error loading file: /test/src/jquery.combine/jquery.combine.js:2: Uncaught TypeError: Cannot set property 'union' of undefined
路径有点不同,但点击它会显示正确的文件。
jquery.combine.js
看起来像这样:
(function($) {
$.union = function () {
// ...
};
}(jQuery));
为什么它没有检测到 jQuery?它正确包含它,因为如果我拼错了路径,它会抱怨缺少文件。