This is one approach for dealing with the async save problem that exists. Eventually we need to re-factor the Game.newInstance function to either return a promise which resolves once we have saved the game in the database or a callback argument which is called once the game is saved in the database. This will require a lot of unit tests to be updated. For the time being this change modified the IDatabase instance only for the SQLite unit test so that we know when the call to saveGame has finished.
This is one approach for dealing with the async save problem that exists. Eventually we need to re-factor the
Game.newInstance
function to either return a promise which resolves once we have saved the game in the database or a callback argument which is called once the game is saved in the database. This will require a lot of unit tests to be updated. For the time being this change modified theIDatabase
instance only for the SQLite unit test so that we know when the call tosaveGame
has finished.