我向上帝发誓这工作,我知道这是因为我的测试传递了一段时间......现在它不。请参阅下面的错误屏幕截图。For循环ES6不再工作
describe('',() => {
let newBoard;
beforeEach(() => {
newBoard = new board();
});
it('',() => {
for(let row in newBoard){
for(let column in row){
newBoard[row][column].should.equal("");
}
}
});
});
board.js
module.exports = function(){
return [["", "", ""],
["", "", ""],
["", "", ""]];
};
什么是'newBoard'吗? –
这不可能像预期的那样工作......第二个循环应该是for(让列在newBoard [row]中)。 (或使用for-of循环)。 –
@LayTaylor它在屏幕截图中说:'newBoard:Array [3]' – Stijn