diff --git a/schlangen_und_leitern/js/boardHandling.js b/schlangen_und_leitern/js/boardHandling.js index ac8043b..6abb8d1 100644 --- a/schlangen_und_leitern/js/boardHandling.js +++ b/schlangen_und_leitern/js/boardHandling.js @@ -286,4 +286,12 @@ function hideStartMenu(){ function changeElement(id, style){ document.getElementById(id).style.display = style; - } \ No newline at end of file + } + + + + + + module.exports = { + buildBoardArray +} \ No newline at end of file diff --git a/schlangen_und_leitern/tests/boardHandling.test.js b/schlangen_und_leitern/tests/boardHandling.test.js new file mode 100644 index 0000000..106e407 --- /dev/null +++ b/schlangen_und_leitern/tests/boardHandling.test.js @@ -0,0 +1,32 @@ +//Importieren der FUnktionen +const { + buildBoardArray + } = require('../js/boardHandling'); + + + let boardEx =[ + [100, 99, 98, 97, 96, 95, 94, 93, 92, 91], + [81, 82, 83, 84, 85, 86, 87, 88, 89, 90], + [80, 79, 78, 77, 76, 75, 74, 73, 72, 71], + [61, 62, 63, 64, 65, 66, 67, 68, 69, 70], + [60, 59, 58, 57, 56, 55, 54, 53, 52, 51], + [41, 42, 43, 44, 45, 46, 47, 48, 49, 50], + [40, 39, 38, 37, 36, 35, 34, 33, 32, 31], + [21, 22, 23, 24, 25, 26, 27, 28, 29, 30], + [20, 19, 18, 17, 16, 15, 14, 13, 12, 11], + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + ]; + + + + +describe('tests ob das boardArray rigtig aufgebaut würde', () => { + + + it('past zum beispiel array', ()=>{ + + expect(buildBoardArray()).toEqual(boardEx); + + }); + +}) \ No newline at end of file