Performance: Integration testing
MEDIUM IMPACT
Integration testing affects development and CI pipeline speed, impacting how quickly changes can be verified and deployed.
beforeAll(async () => { const moduleRef = await Test.createTestingModule({ imports: [SpecificModule], }).compile(); app = moduleRef.createNestApplication(); await app.init(); });
beforeEach(async () => { const moduleRef = await Test.createTestingModule({ imports: [AppModule], }).compile(); app = moduleRef.createNestApplication(); await app.init(); });
| Pattern | Test Initialization Time | Resource Usage | Parallelizability | Verdict |
|---|---|---|---|---|
| Full AppModule per test | High (500ms+) | High (DB, services) | Low | [X] Bad |
| Specific Module once per suite | Low (100ms) | Low | High | [OK] Good |