我試圖瞭解qunit測試qunit測試錯誤等於和deepEqual
爲什麼這個測試失敗?如果我比較每個屬性,是相同的...
test("Get model equal", function() {
function getModel() {
function myModel() {
this.name = "";
this.address = "";
this.phone = "";
}
return new myModel();
}
var model1 = getModel();
var model2 = getModel();
equal(model1, model2);
});
test("Get model deepEqual", function() {
function getModel() {
function myModel() {
this.name = "";
this.address = "";
this.phone = "";
}
return new myModel();
}
var model1 = getModel();
var model2 = getModel();
deepEqual(model1, model2);
});
哪個比較失敗? –
我現在做兩個測試,兩個都失敗... –