我在代码中包含以下行:
window.parent.location.href = someCalculatedVal
在测试中,我想验证window.parent.location.href
的值正确
此行expect(window.parent.location.href).toEqual(DOMAIN + "/failureUrl");
无效:
Error: expect(received).toEqual(expected) // deep equality
Expected: "http://www.example.com/failureUrl"
Received: "http://localhost/"
我看起来好像它需要运行的窗口而不是实际的窗口,