Testing the Middleware and Application

We have shown how to exercise the Node JS-based middleware and application capabilities using sample scripts and curl commands. By observing the console output, you can find out if the application works as expected. For a production application, you will need a more robust and maintainable testing methodology that can evaluate correctness of the library functions and API endpoints on an ongoing basis. Both unit tests and integration tests should be part of your evaluation process. A hands-on demonstration of such testing is beyond the scope of this chapter, and writing unit and integration tests is left as an exercise to the reader. Mocha, which is a feature-rich JavaScript framework for asynchronous testing(https://mochajs.org/), can be used for this purpose.

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

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