dwyl / learn-tdd

:white_check_mark: A brief introduction to Test Driven Development (TDD) in JavaScript (Complete Beginner's Step-by-Step Tutorial)
Mozilla Public License 2.0
2.74k stars 349 forks source link

Difference between Unit and Integration Tests? #126

Open nelsonic opened 5 years ago

nelsonic commented 5 years ago

A unit test exercises a function for one layer of your application. For example, if you’re testing a web calculator, unit tests would exercise the Calculator module supporting your arithmetic. You might dedicate one or more tests to the add function on your calculator module.

An integration test focuses on the way different layers of an application fit together. Our integration tests in this chapter will generally do a request to a controller to use the things we’ve created so far. A single test will begin at our endpoint, run through our pipelines, read from the database, and render templates through views just as Phoenix requests would.

from p.146 of Programming Phoenix 1.4.

Todo