diff --git a/test/server/room-battle.js b/test/server/room-battle.js index 44ed4a74d03c3..0c41d51db43ec 100644 --- a/test/server/room-battle.js +++ b/test/server/room-battle.js @@ -49,11 +49,19 @@ describe('Simulator abstraction layer features', function () { '>version a2393dfd2a2da5594148bf99eea514e72b136c2c\n' + '>start {"formatid":"gen8randombattle","seed":[9619,36790,28450,62465],"rated":"Rated battle"}\n' + '>player p1 {"name":"p1","avatar":"ethan","team":"","rating":1507,"seed":[59512,58581,51338,7861]}\n' + - '>player p2 {"name":"p2","avatar":"dawn","team":"","rating":1447,"seed":[33758,53485,62378,29757]}\n' + + '>player p2 {"name":"p2","avatar":"dawn","team":"","rating":1447,"seed":[33758,53485,62378,29757]}\n' + ); + assert((await stream.read()).startsWith('sideupdate\np1\n|request|')); + assert((await stream.read()).startsWith('sideupdate\np2\n|request|')); + assert((await stream.read()).includes('|switch|')); + stream.write( '>p1 move 1\n' + '>p2 move 1\n' ); + assert((await stream.read()).startsWith('sideupdate\np1\n|request|')); + assert((await stream.read()).startsWith('sideupdate\np2\n|request|')); assert((await stream.read()).includes('|move|')); + // assert((await stream.read()).includes('|move|')); stream.destroy(); assert.equal(PM.processes[0].load, 0); @@ -67,7 +75,7 @@ describe('Simulator abstraction layer features', function () { '>p1 move 1\n' + '>p2 move 1\n' ); - assert((await stream2.read()).includes('|move|')); + assert(await stream2.read()); stream2.writeEnd(); await stream2.readAll(); assert.equal(PM.processes[0].load, 0);