From 88f6dfde1ff98883479f8ed384b7d1b9ad159943 Mon Sep 17 00:00:00 2001 From: StevanFreeborn Date: Thu, 26 May 2022 19:41:42 -0500 Subject: [PATCH] updated unit test to test all puzzle and solution combos in puzzle-strings.js --- tests/1_unit-tests.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/1_unit-tests.js b/tests/1_unit-tests.js index 7139435..371cab9 100644 --- a/tests/1_unit-tests.js +++ b/tests/1_unit-tests.js @@ -125,12 +125,16 @@ suite('UnitTests', () => { }); - test('solve(puzzleString) uncomplete puzzle yields expected solution', (done) => { + test('solve(puzzleString) uncomplete puzzles yield expected solutions', (done) => { - const puzzle = puzzlesAndSolutions[0][0]; - const solution = puzzlesAndSolutions[0][1]; + puzzlesAndSolutions.forEach(element => { + + const puzzle = element[0]; + const solution = element[1]; + assert.equal(solver.solve(puzzle), solution); + + }); - assert.equal(solver.solve(puzzle), solution); done(); });