mkraenz / phaser3-typescript-project-template

template project setup for phaser 3 game development with TypeScript - useful template for any ts project - webpack, unit testing, coverage, linting, git-hooks
MIT License
1 stars 0 forks source link

tests for phaser related code #13

Open mkraenz opened 5 years ago

mkraenz commented 5 years ago

Writing (unit) tests for classes that use phaser, e.g. MainScene results in npm test to fail. Those classes should be testable, too.

mkraenz commented 5 years ago

At the very least, one can debug inside chrome (and probably firefox) by using the sources tab inside the dev tools (ctrl + shift + i). Search the file you want to debug with ctrl + P. Then simply add a breakpoint. Once the line is executed the debug session starts.

mkraenz commented 5 years ago

The only obvious change by adding devtool to webpack is that you get a message Found source files, use ctrl + P when opening bundle.js.

mkraenz commented 5 years ago

See https://stackoverflow.com/questions/32385219/mocha-tests-dont-run-with-webpack-and-mocha-loader