From 5f3d392f1f4a60c1180cdffe9fbe13a598f2b943 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 21 Jul 2020 12:41:04 -0700 Subject: [PATCH] Remove timestamps in state tests --- test/sim/misc/state.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/sim/misc/state.js b/test/sim/misc/state.js index 24c3e80ffbae2..15ca78de3fac7 100644 --- a/test/sim/misc/state.js +++ b/test/sim/misc/state.js @@ -20,6 +20,12 @@ const TEAMS = [[ {species: 'Snorlax', ability: 'thickfat', item: 'leftovers', moves: ['rest']}, ]]; +function normalizeState(state) { + state.log = state.log.map(line => line.startsWith(`|t:|`) ? `|t:|` : line); + console.log(state); + return state; +} + describe('State', function () { describe('Battles', function () { it('should be able to be serialized and deserialized without affecting functionality (slow)', function () { @@ -31,7 +37,7 @@ describe('State', function () { control.makeChoices(); test.makeChoices(); - assert.deepEqual(test.toJSON(), control.toJSON()); + assert.deepEqual(normalizeState(test.toJSON()), normalizeState(control.toJSON())); // Roundtrip the test battle to confirm it still works. const send = test.send;