Chapter 15. Testing Framework
Testing your code is like flossing: you know that it is important for the hygiene of your codebase, but you neglect to do it anyway. Why is this? Many developers complain that testing is painful: “Tests are too hard to write,” “Writing tests is boring,” or “Testing makes my gums bleed.” Much of this has to do with your coding style and the tools that you use for testing (though if your gums actually start bleeding when you write tests, you should have that checked out). Fortunately, the way that code is written in the Closure Library makes it easy to inspect values from your tests and to mock out functionality to reduce the amount of setup required to create a test. Writing tests will let you respond to your teammates with confidence when they ask about how much “flossing” you have done to ensure that your code will work in production.