Unit Tests Flashcards
What are unit tests?
A unit test is a way of testing a unit - the smallest piece of code that can be logically isolated in a system. In most programming languages, that is a function, a subroutine, a method or property.
Why is it important to write unit tests?
Good way to debug code and can help test when refactoring code.
What code should be tested with a unit test? What code is not well suited for unit tests?
A single unit.
Large blocks of code (e.g. multiple components talking to each other)
What is Jest? What are some other popular JavaScript unit testing frameworks?
Jest is a JavaScript testing framework built on top of Jasmine and maintained by Meta.
Other popular JavaScript unit testing frameworks include Mocha, Cypress, Selenium, QUnit, and Cucumber.