Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Why Test?

In the last hour, you learned about how to debug Node.js applications, and you may be asking why you need to write tests for your application with such powerful debugging tools. Writing tests for applications is something that many developers do not do. This can work if the codebase is small and there is only one developer on the project. But, as applications change and become more complex, it is increasingly difficult to ensure of the stability of code. Tests are repeatable pieces of code that assert that your application is functioning in the way that you expect it to. Examples of tests that you might write include the following:

• Does an HTTP response return a 200 code?

• Does a method return a particular value?

• Does a method return a string?


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint