You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
So far, we've been writing just one test using a single it() block. However, in most situations, we will need to write many tests for a particular feature that get executed in succession.
Running multiple test can introduce issues if the tests make changes to the testing environment: changes to the environment in one test might affect the next test. Some common changes to an environment include:
altering files and directory structure
changing read and write permissions on a file
editing records in a database
To address this issue, we often add a teardown step to the end of our tests. The teardown phase makes our tests isolated by resetting the environment before the next test runs. This provides two key benefits:
Changes of the environment caused by one test do not affect the other tests.
Isolated tests can be executed in any order.
Note: In some cases -including the previous exercises- the teardown phase isn't needed because there are no conditions to reset.
So far, we've been writing just one test using a single it() block. However, in most situations, we will need to write many tests for a particular feature that get executed in succession.
Running multiple test can introduce issues if the tests make changes to the testing environment: changes to the environment in one test might affect the next test. Some common changes to an environment include:
To address this issue, we often add a teardown step to the end of our tests. The teardown phase makes our tests isolated by resetting the environment before the next test runs. This provides two key benefits: