diff --git a/Backtracking/tests/KnightTour.test.js b/Backtracking/tests/KnightTour.test.js index a3af01a095..f7dc511df9 100644 --- a/Backtracking/tests/KnightTour.test.js +++ b/Backtracking/tests/KnightTour.test.js @@ -11,7 +11,7 @@ describe('OpenKnightTour', () => { [0, 0, 0, 0, 0] ]) - KT.solve() + expect(KT.solve()).toBe(true) expect(KT.board).toEqual([ [19, 4, 15, 10, 25], [14, 9, 18, 5, 16], @@ -20,4 +20,18 @@ describe('OpenKnightTour', () => { [21, 2, 7, 12, 23] ]) }) + + it('OpenKnightTour(2)', () => { + const KT = new OpenKnightTour(2) + expect(KT.board).toEqual([ + [0, 0], + [0, 0] + ]) + + expect(KT.solve()).toBe(false) + expect(KT.board).toEqual([ + [0, 0], + [0, 0] + ]) + }) })