Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用 Jasmine 测试框架,对此我很陌生。
我试图模拟后端,当我调用微风的 saveChanges 时,我得到了某种模拟响应。或者也许这不是最快的选择。
我尝试使用 spyOn($,'ajax') 和随后的 expect($.ajax.mostRecentCall.args[0]["url"]).toEqual("/api/git/SaveChanges")。但不幸的是,这是未定义的错误......微风的 saveChanges 似乎没有进行 ajax 调用?
有人可以帮忙吗?
我们想为您提供一些指导。我们正在努力,但目前还没有。也许你会先到达那里。但是你必须学会伪造 XHR 流量,是的,微风saveChanges方法最终成为 XHR POST。
saveChanges
每个方向的有效载荷都有点复杂,但您可以从真实流量中捕获它们并为您的测试进行调整。至少我会这样开始。