|
@ -1,7 +1,8 @@ |
|
|
//Importieren der FUnktionen
|
|
|
//Importieren der FUnktionen
|
|
|
const { |
|
|
const { |
|
|
buildBoardArray, |
|
|
buildBoardArray, |
|
|
generateBoardObjects |
|
|
|
|
|
|
|
|
generateBoardObjects, |
|
|
|
|
|
boardObject |
|
|
} = require('../js/boardHandling'); |
|
|
} = require('../js/boardHandling'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -46,6 +47,20 @@ describe('testen ob alle board objekte korrekt initialisiert wird', () => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('prüfen, ob jedem Objekt der richtige Typ zugeordnet ist', ()=>{ |
|
|
|
|
|
let obArr = [] ; |
|
|
|
|
|
generateBoardObjects(leitern, schlangen, obArr); |
|
|
|
|
|
|
|
|
|
|
|
for(let i = 0; i < obArr.length; i++){ |
|
|
|
|
|
//prüfen leitern
|
|
|
|
|
|
if(obArr[i].start < obArr[i].end) |
|
|
|
|
|
expect(obArr[i].type).toBe("l"); |
|
|
|
|
|
//prüfen schlange
|
|
|
|
|
|
else { |
|
|
|
|
|
expect(obArr[i].type).toBe("s"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|