如何为下面的代码行创建间谍
this.$('#crumb').dropdown('toggle');
我尝试过使用:spyOn($, 'dropdown');
但收到以下错误消息
TypeError: this.$(...).dropdown is not a function
答案 0 :(得分:0)
在Karma配置文件中,您需要添加来自供应商或node_modules
文件夹的文件路径:
"node_modules/jquery/dist/jquery.js",
"node_modules/bootstrap/dist/js/bootstrap.min.js",