Test with Jest Free Download
2 Likes Comment

Test with Jest, FreeTuts Download

 Test with Jest   Free Tutorial Download

What testing means?

In tech jargon testing means checking that our code meets some expectations. For example: a function called “transformer” should returns the expected output given some input.

There are many types of testing and soon you’ll be overwhelmed by the terminology, but long story short tests fall into three main categories:

  • unit testing
  • integration testing
  • UI testing

In this Jest tutorial we’ll cover only unit testing, but at the end of the article you’ll find resources for the other types of tests.

Jest Tutorial: what is Jest?

Jest is a JavaScript test runner, that is, a JavaScript library for creating, running, and structuring tests.

Jest ships as an NPM package, you can install it in any JavaScript project. Jest is one of the most popular test runner these days, and the default choice for React projects.

First things first: how do I know what to test?

When it comes to testing, even a simple block of code could paralyze beginners. The most common question is “How do I know what to test?”.

If you’re writing a web application a good starting point would be testing every page of the app and every user interaction. But, web applications are also made of units of code like functions and modules that need to be tested too.

There are two scenarios most of the times:

  • you inherit legacy code which comes without tests
  • you have to implement a new functionality out of thin air
Read more course:  Digital Marketing Strategy for Beginners - 2020 Part 1 of 6

What to do? For both cases you can help yourself by thinking of tests as of bits of code that check if a given function produces the expected result. Here’s how a typical test flow looks like:

  1. import the function to test
  2. give an input to the function
  3. define what to expect as the output
  4. check if the function produces the expected output

Really, that’s it. Testing won’t be scary anymore if you think in these terms: input – expected output – assert the result.

Now hands on Jest!


Download Test with Jest   Free

Go to Download Tutorials Page

Password : freetuts.download

You might like

About the Author: minhtri

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.