在茉莉测试中,角分不确定

发布于 2025-01-21 05:36:56 字数 450 浏览 1 评论 0原文

请帮忙。

我认为我正确定义了测试配置。

但这给Layoutservice带来了提供商错误。

我的测试代码“

Please help.

I think I defined test configs right.

But this throws Provider error for LayoutService.

This is my test code

This is the error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烈酒灼喉 2025-01-28 05:36:56

createSpyObj具有以下描述
文档:

茉莉花 )

该方法将要模拟的服务名称作为参数,第二个参数是需要模拟该类中所有方法的数组。

您应该将代码使用的原始服务名称和方法传递给间谍对象。

spyLayoutService = jasmine.createSpyObj('CsLayoutService', ['...'])

createSpyObj has the following description from the
Jasmine documentation:

createSpyObj(baseName, methodNames, propertyNames)

The method takes as arguments the name of the Service to be mocked, and the second argument is an array of all the methods inside that class that needs to be mocked.

You should pass to your spy object the original service name and methods that are used by your code.

spyLayoutService = jasmine.createSpyObj('CsLayoutService', ['...'])
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文