角茉莉测试 - 子字符串从数字中删除
我在单元测试功能方面遇到了一些困难。我在这些事情上是新手,我不知道我能做什么。 我必须对那两个。
有建议吗?谢谢。
I have some difficulties in unit testing a function. I'm new in these things and I don't know what I can do.
I have to those 2 if.
Any advice? Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的问题是
Jasmine.createspy(Phonenumber);
,由于该方法正在测试中,因此我们不应该监视它,而是实际上称其为其实现。尝试以下内容:
I think your issue is the
jasmine.createSpy(phoneNumber);
, since this method is under test, we should not spy on it but rather actually call its implementation.Try the following: