次の単体テストが合格しない理由を知っている人はいますか?
describe("just a test", function () {
it("should set the iframe location", function () {
$('body').append('<iframe id="myiframe" name="myiframe"</iframe>');
expect(window['myiframe'].location.href).toEqual('about:blank');
window['myiframe'].location.assign('about:history');
expect(window['myiframe'].location.href).toEqual('about:history');
});
});
これは、実際のテストが機能しない理由を調べるための単純化されたコードです。クリーンアップなどについては気になりません。
2番目の期待は失敗します。このようにiframeの場所を変更しても機能しない理由はありますか?
(私は、Visual Studioアドインとコマンドラインの両方を使用して、Chutzpah v1.4.2でテストを実行しています。)