javascript - 茉莉花测试中来自js文件的模拟函数
问题描述
我的 html 中加载了一个 js 文件:
<script src="https://domain.code.js"
type="text/javascript"></script>
并在服务中使用它,我声明它:
declare function someFunction(value: string): string;
现在,在测试此服务时,我想在我的 jasmine 测试中调用存根版本。谁能告诉我该怎么做?
解决方案
推荐阅读
- ruby-on-rails - 使用循环查询重构
- angular - Angular 9 - 在反应式表单控件上手动设置错误不会改变表单状态
- react-native - 当后台应用程序本机反应时如何保持redux saga运行
- python - 当我尝试使用我的网络摄像头(python)时出错
- javascript - 获取长度
- 使用 Bootstrap 4 选项卡内容时
- javascript - Next.js 在启动应用程序时运行函数/脚本
- c# - c# split 方法不适用于西里尔文
- neo4j - Inserver 距离计算和结合 Neo4j 查询
- sonarqube - 在詹金斯的 JAVA_HOME 中找不到“java”可执行文件
- typescript - 打字稿导入/导出给出“SyntaxError: Unexpected token 'export'”