From 7ddfae5e90df873212a3a1ae3f340041fa0ce55c Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Tue, 5 Jun 2018 13:58:34 +0300 Subject: [PATCH] Fix names --- tests/DaemonTest.js | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/DaemonTest.js b/tests/DaemonTest.js index d189fbf..d872e88 100644 --- a/tests/DaemonTest.js +++ b/tests/DaemonTest.js @@ -12,42 +12,34 @@ test('Daemon 1-1', function() { const m = new History(); const d = new Daemon(1, 1); - const step_slice = s => { - return [].concat( - s.slice(-1).slice.map(i => i.robot), - s.slice(-1).slice.map(i => i.human) - ); - }; - const steps = [ { - robot: 0, + prediction: 0, human: 1, }, { - robot: 0, + prediction: 0, human: 1, }, { - robot: 1, + prediction: 1, human: 1, }, { - robot: 0, + prediction: 0, human: 1, }, { - robot: 1, + prediction: 1, human: 1, }, ]; steps.forEach((step, index) => { - const robot = d.predict(m); - // expect(d._getStepSlice(m)).toEqual(step_slice(steps)); - expect(robot).toEqual(step.robot); + const prediction = d.predict(m); + expect(prediction).toEqual(step.prediction); d.adjust(m, step.human, index + 1); - m.makeMove(step.human, step.robot); + m.makeMove(step.human, step.prediction); console.log('Step', index + 1, d); }); });