Skip to content

Testing and Linting

HaileyJang edited this page Aug 20, 2020 · 1 revision

Testing and Linting

Chai and Mocha

The Test-Driven Development framework for JavaScript, Mocha is used to test Dawn for edge cases. Chai is included to allow for greater flexibility on how to test items. We currently test various actions, or IPC messages, and reducers, or state changes. It can be run through make dawn-test in the top dawn directory.

Given the high probability that there will be only one working test robot, Fake Runtime is created to test protocol and APIs. It tests to make sure both sides can decode and encode protobufs as defined here. It also tests how Dawn deals with different kinds of sensor data and message amount, with the latter customizable (SENDRATE measured in ms).

To maintain code quality, Dawn uses ESLint to enforce good practices. In doing so, it will fail to compile one's work unless it is fully complaint with current rules, which is currently based off of AirBnb's best practices. Any modifications for the rules can be created in .eslintrc or .eslintignore. Please try to minimize changes on these as extensive changes may negate the benefits of linting.

Clone this wiki locally