首页 > 解决方案 > 茉莉花测试中来自js文件的模拟函数

问题描述

我的 html 中加载了一个 js 文件:

<script src="https://domain.code.js" 
type="text/javascript"></script>

并在服务中使用它,我声明它:

declare function someFunction(value: string): string;

现在,在测试此服务时,我想在我的 jasmine 测试中调用存根版本。谁能告诉我该怎么做?

标签: javascriptangulartypescriptjasmine

解决方案


推荐阅读