Your First Test
Let's take a look at some tests using Jest.
Jest test
A Jest test uses the it
function, which takes two arguments. The first argument is the name of the test. By convention, it’s written to be read with the word “it”. So, below, we see it('sums numbers', ...)
reads like “it sums numbers”. We should try to keep the test names as readable and meaningful as we can. The test results will show this string together with the test result and the time it took. The second argument is a function, typically written using the arrow notation.
Try it yourself
...Access this course and 1400+ top-rated courses and projects.