|
|
@ -4,7 +4,8 @@ PlayerBuilder, |
|
|
|
buildPlayerArray, |
|
|
|
movePlayer, |
|
|
|
over100, |
|
|
|
landedOn |
|
|
|
landedOn, |
|
|
|
resetNewOld |
|
|
|
} = require('../js/playerHandling'); |
|
|
|
|
|
|
|
let player = {"position": 1, "newPosition": 1, "won": false}; |
|
|
@ -106,3 +107,23 @@ describe('tests testen', () => { |
|
|
|
}); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
describe('testen, ob die neue Position die aktuelle Position ersetzt ', () => { |
|
|
|
|
|
|
|
|
|
|
|
it('mit einer Zufallszahl von 1 bis 100 zwanzigmal', ()=>{ |
|
|
|
for(let i = 0; i <= 20; i++) |
|
|
|
{ |
|
|
|
min = Math.ceil(1); |
|
|
|
max = Math.floor(100); |
|
|
|
let position = Math.floor(Math.random() * (max - min + 1) + min) |
|
|
|
|
|
|
|
let player = {"position": 1, "newPosition": position, "won": false} |
|
|
|
resetNewOld(player); |
|
|
|
expect(player).toEqual({"position": position, "newPosition": 0, "won": false}); |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}) |