TheFiveMemberTeam / Retrograde-DarkOrbit

0 stars 0 forks source link

For `lobbies.test.js` check if a created lobby exists in 'get # players in lobby' and 'get # ready players in lobby' tests #19

Closed JacobAKnox closed 5 months ago

JacobAKnox commented 6 months ago

30 mins

JacobAKnox commented 6 months ago

https://github.com/TheFiveMemberTeam/Retrograde-DarkOrbit/blob/5b031164d29d716264b490f4734f3c7437854685/server/lobbies/lobbies.js#L89 You don't check if the lobby exists here

https://github.com/TheFiveMemberTeam/Retrograde-DarkOrbit/blob/5b031164d29d716264b490f4734f3c7437854685/server/lobbies/lobbies.js#L80-L84 https://github.com/TheFiveMemberTeam/Retrograde-DarkOrbit/blob/5b031164d29d716264b490f4734f3c7437854685/server/lobbies/lobbies.test.js#L92-L95 There is no wrapper around players, its just lobby

https://github.com/TheFiveMemberTeam/Retrograde-DarkOrbit/blob/5b031164d29d716264b490f4734f3c7437854685/server/lobbies/lobbies.test.js#L115-L116 We know it exists here, we want to make sure it fails gracefully if you pass one that doesn't exist.

JacobAKnox commented 6 months ago

https://github.com/TheFiveMemberTeam/Retrograde-DarkOrbit/blob/afe663bdfbc37ecd548f029a9a679763aff61b11/server/lobbies/lobbies.js#L78C1-L98C2 return 0 when you can't find the lobby is probably not ideal, but I can't think of a better solution. We can discuss this in the next meeting.

There should be a test for when get_num_ready_players is passed a lobby that doesn't exist.

JacobAKnox commented 6 months ago

looks good, no further feedback from me