Setup and Teardown

Example without setup/teardown

Class Name – beforeAndAfterEach.js

Result:

In above example it is failing because num value got increased in 1st test case. Below is how we can solve that by adding beforeEach which run for every test case.

Leave a Reply

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