Not a “best practice” by any means, but in the development of my game I have two types of tests:
- unit testing for game logic that can be ran server side
- e2e testing for game behavior, from the user’s point of view (acceptance testing)
here’s one example mana-battle/specifications.spec.ts at master · lfarroco/mana-battle · GitHub
the tests run on every commit and are good to catch regressions (here’s one example run Merge pull request #106 from lfarroco/dependabot/npm_and_yarn/babel/core-7.16.5 · lfarroco/mana-battle@b14c938 · GitHub)
You also have the option of mocking Phaser if your testing code has side effects so that you can assert if you are calling the framework with the expected parameters.