Angular单元测试的一个错误消息
发布日期:2021-06-30 14:32:45 浏览次数:2 分类:技术文章

本文共 508 字,大约阅读时间需要 1 分钟。

错误消息:

‘expect’ was used when there was no current spec, this could be because an asynchronous test timed out

原始的单元测试代码:

describe('Jerry for Spartacus unit test', () => {
const valueService = new ValueService(); expect(valueService.getValue()).toEqual('Jerry');} );

解决方法

describe('Jerry for Spartacus unit test', () => {
it('#getValue unit test here!', () => {
const valueService = new ValueService(); expect(valueService.getValue()).toEqual('Jerry'); });});

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

转载地址:https://jerry.blog.csdn.net/article/details/108852457 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:SAP Spartacus HttpParamsURIEncoder单元测试文件备份
下一篇:Angular单元测试如何只执行指定的测试用例,提高测试速度

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月24日 16时58分21秒