diff --git a/schlangen_und_leitern/js/playerHandling.js b/schlangen_und_leitern/js/playerHandling.js index a484bae..386980c 100644 --- a/schlangen_und_leitern/js/playerHandling.js +++ b/schlangen_und_leitern/js/playerHandling.js @@ -217,5 +217,6 @@ function landedOn (player, objectArr){ module.exports = { PlayerBuilder, buildPlayerArray, - movePlayer + movePlayer, + over100 } \ No newline at end of file diff --git a/schlangen_und_leitern/tests/playerHandling.test.js b/schlangen_und_leitern/tests/playerHandling.test.js index a06dc66..29bdb33 100644 --- a/schlangen_und_leitern/tests/playerHandling.test.js +++ b/schlangen_und_leitern/tests/playerHandling.test.js @@ -1,5 +1,12 @@ //Importieren der FUnktionen -const { PlayerBuilder, buildPlayerArray, movePlayer } = require('../js/playerHandling'); +const { +PlayerBuilder, +buildPlayerArray, +movePlayer, +over100 +} = require('../js/playerHandling'); + +let player = {"position": 1, "newPosition": 1, "won": false}; //example player array let playerArr2 = [ @@ -41,10 +48,25 @@ describe('Testen ob das movePlayer funkction:', () => { it('die Position bei jeder möglichen Rolle korrekt ändert', ()=>{ for(let i = 0; i { + + //Ein Test mit Name und Funktion + it('101 bis 130 wieder auf 100 setzen', ()=>{ + for(let i = 1; i <30; i++){ + let player = {"position": 1, "newPosition": 100, "won": false}; + over100(player); + expect(player).toEqual({"position": 1, "newPosition": 100, "won": false}); } + }); -}) \ No newline at end of file +})