From eb78b5981eb7fa9c74dfc0cf3a87fc7b722ec8a4 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/sim/misc/state.js b/test/sim/misc/state.js index 24c3e80ffb..578e22c834 100644 --- a/test/sim/misc/state.js +++ b/test/sim/misc/state.js @@ -20,6 +20,11 @@ const TEAMS = [[ {species: 'Snorlax', ability: 'thickfat', item: 'leftovers', moves: ['rest']}, ]]; +function normalizeState(state) { + state.log = state.log.map(line => line.startsWith(`|t:|`) ? `|t:|` : line); + return state; +} + describe('State', function () { describe('Battles', function () { it('should be able to be serialized and deserialized without affecting functionality (slow)', function () { @@ -31,7 +36,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;