Skip to content

Commit

Permalink
feat(server): Lobby API improvements (#675)
Browse files Browse the repository at this point in the history
* feat(server): Improve game creation API input checks
  - Move default numPlayers to CreateGame method
  - Only add setupData to metadata if not undefined
  - Ensure unlisted is always a boolean value

* refactor(server): Improve typings in API code

* feat(server): Throw 404 from create endpoint if game not found

* test(server): Improve typing in API tests

* feat(server): Use db.createGame method in Lobby API
    Use Storage API’s createGame method instead of calls to setState & 
setMetadata in the lobby API

* test(server): Add test for 404 error if game to create doesn’t exist

* test(server): Refactor nesting of Lobby API tests

* test(server): Test join endpoint with & without custom player data

* test(server): Break up game creation tests for each API option

Co-authored-by: Nicolo John Davis <nicolodavis@gmail.com>
  • Loading branch information
delucis and nicolodavis authored May 9, 2020
1 parent b9a2a73 commit b2d6b06
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 154 deletions.
Loading

0 comments on commit b2d6b06

Please sign in to comment.