简体   繁体   English

茉莉花创建间谍时找不到功能

[英]Jasmine cannot find function when creating spy

How to create spy for the below line of code 如何为以下代码行创建间谍

this.$('#crumb').dropdown('toggle');

i have tried using : spyOn($, 'dropdown'); 我试过使用: spyOn($, 'dropdown');

but getting below error message 但出现以下错误信息

TypeError: this.$(...).dropdown is not a function

In the Karma config file, you need to add the file paths from vendor or node_modules folder: 在Karma配置文件中,您需要从vendor或node_modules文件夹添加文件路径:

"node_modules/jquery/dist/jquery.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM