Learn

Great work! We have covered a lot over this lesson. Let’s take a moment to review:

  • We have learned that Jest is an easy-to-use framework for testing in a JavaScript environment because it combines a test-runner with assertion methods like the expect() API.
  • We also learned some of the basic syntax involved with creating a simple unit test, such as the test() function.
  • After tackling basic unit tests we adventured into the realm of testing asynchronous code with Jest by using the done parameter to wait for asynchronous callbacks and the async/await keywords to wait for Promises to resolve
  • Lastly, we learned how to mock functions using jest.fn() and make use of mocked modules with jest.mock() by mocking the Axios module.

While we have learned a lot there is always more knowledge to be obtained and we encourage you to continue exploring Jest and its wonderful features!

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?