Recall & Review
beginner
What is integration testing in NestJS?
Integration testing in NestJS checks how different parts of the application work together, like controllers, services, and modules, to ensure they interact correctly.
Click to reveal answer
beginner
Which NestJS testing utility helps create a testing module for integration tests?
The
Test.createTestingModule() method helps build a testing module that mimics the real module setup for integration testing.Click to reveal answer
intermediate
Why do we use
beforeEach or beforeAll hooks in NestJS integration tests?These hooks set up the testing environment before each or all tests run, like creating the testing module and initializing the app instance.
Click to reveal answer
intermediate
How do you test HTTP endpoints in NestJS integration tests?
You use the
supertest library to send HTTP requests to the NestJS app instance and check the responses to verify endpoint behavior.Click to reveal answer
beginner
What is the difference between unit testing and integration testing in NestJS?
Unit testing checks individual parts in isolation, while integration testing checks how multiple parts work together in the app.
Click to reveal answer
Which method creates a testing module in NestJS integration tests?
✗ Incorrect
Test.createTestingModule() builds a testing module for integration tests.
What library is commonly used to test HTTP requests in NestJS integration tests?
✗ Incorrect
supertest sends HTTP requests to the NestJS app during integration tests.
In NestJS, where do you usually initialize the app instance for integration testing?
✗ Incorrect
beforeEach or beforeAll hooks set up the app instance before tests run.
Integration testing in NestJS mainly focuses on:
✗ Incorrect
Integration tests check interaction between modules and services.
Which of these is NOT a typical step in NestJS integration testing setup?
✗ Incorrect
Tests should avoid modifying the production database.
Explain how to set up a basic integration test in NestJS for an HTTP endpoint.
Think about how you prepare the app and send requests to test endpoints.
You got /4 concepts.
Describe the main difference between unit testing and integration testing in NestJS.
Focus on scope and interaction of tested parts.
You got /4 concepts.