The CesiumJS team recently published a blog post on testing: how to write, run & debug unit tests.
Testing is central CesiumJS. More than 50% of the code in CesiumJS is unit tests; Cesium has ~90% code coverage, and we strive for 100%. Check out the details: