Skip to content

Commit

Permalink
Remove timestamps in state tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed Jul 21, 2020
1 parent 10e4ecd commit 5f3d392
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/sim/misc/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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;
Expand Down

0 comments on commit 5f3d392

Please sign in to comment.