Testing is an essential part of development. When used properly, testing can catch and identify issues with your implementation code before you deploy it to users. Instead of testing every function manually, developers automate their tests with a test framework.
In this lesson you will:
- Learn to write a basic Mocha test suite
- Use Node’s
assert.okmethod to verify the expected output of your code
- Understand and apply the four phases of a test to create an expressive testing suite
- Evaluate the quality of your tests against the characteristics of a good test
A complete test suite is provided for you on the right. Run the suite and view its output by typing
npm test in the terminal and hitting Enter.
Can you match the test output in your terminal to strings in index_test.js?