Testing Your Code

Up until this point, we've been pretty much flying by the seat of our pants when it comes to the code we've been writing. We literally had no way of knowing whether the code worked until we tested it out in an actual browser.

In this chapter, we will cover the following topics:

  • Running tests with the Mocha test framework
  • Writing tests with the Chai.js assertion library
  • Spies and stubs with Sinon and Proxyquire
  • Writing your first test
  • Testing your application

Tests are great for ensuring that your code functions properly, but they're also awesome for preventing new, unexpected bugs from suddenly popping up because of an innocent little change you made to some unsuspecting code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.179.35