Recall & Review
beginner
What is a unit test in Express?
A unit test checks a small part of your Express app, like a single function or middleware, in isolation without involving other parts or external systems.
Click to reveal answer
beginner
What does an integration test do in Express?
An integration test checks how different parts of your Express app work together, like routes, middleware, and database calls, to ensure they cooperate correctly.
Click to reveal answer
intermediate
When should you choose a unit test over an integration test?
Choose a unit test when you want to quickly check a small piece of code without external dependencies, making tests fast and easy to fix if broken.
Click to reveal answer
intermediate
Why are integration tests important in Express apps?
Integration tests catch problems that happen when parts of the app interact, like route handlers calling the database, which unit tests alone might miss.
Click to reveal answer
intermediate
What is a key sign you need an integration test in Express?
If your feature depends on multiple parts working together, like middleware, routes, and database, you need an integration test to check the full flow.
Click to reveal answer
Which test focuses on a single function without external systems?
✗ Incorrect
Unit tests isolate one function or module, ignoring external parts.
What does an integration test in Express usually include?
✗ Incorrect
Integration tests check how different parts like routes and database interact.
When is a unit test preferred over an integration test?
✗ Incorrect
Unit tests are best for small, isolated pieces of code.
Which test type is slower but checks more parts working together?
✗ Incorrect
Integration tests involve multiple components and take longer to run.
What is a sign you should write an integration test in Express?
✗ Incorrect
Integration tests are needed when routes interact with databases or other services.
Explain the main difference between unit tests and integration tests in Express.
Think about testing one piece vs testing how pieces connect.
You got /4 concepts.
Describe a situation in an Express app where you would choose an integration test instead of a unit test.
Consider when parts depend on each other.
You got /4 concepts.