//spec
it('check process data to see if it returns correct JSON object', function() {
var dataExpected = [];
dataExpected.push({
image : "https://katmou.files.wordpress.com/2011/11/blade_runner.jpeg",
title : "Harrison",
id : 1
});
expect(dataAfter).toEqual(dataExpected);
});
錯誤:茉莉的幫助,希望不工作
[ERROR] : . THERE WERE FAILURES!
[ERROR] : . ============================================================
[ERROR] : . Recap of failing specs:
[ERROR] : . ------------------------------------------------------------
[ERROR] : . viewP controller check process data to see if it returns correct JSON object. - Expected [ { image : 'https://katmou.files.wordpress.com/2011/11/blade_runner.jpeg', title : 'Harrison', id : '1' } ] to equal [ { image : 'https://katmou.files.wordpress.com/2011/11/blade_runner.jpeg', title : 'Harrison', id : 1 } ].
的數據之後是相同的期望是什麼,它仍然是失敗的,爲什麼呢?
乾杯。
您是否試過使用'expect(dataAfter).toMatch(dataExpected);'? – Sobieck