# E2E Testing — नेस्टजेएस

Source: https://www.geekswithgeeks.com/hi/nestjs/nestjs-e2e-testing

> आपके application की full end-to-end testing।

## E2E setup और fixtures

Test database और fixtures को setup करें; हर test के बाद उन्हें tear down करें।

```typescript
beforeAll(async () => {
  // spin up test database
  // seed with test data
});

afterEach(async () => {
  // clean up created records
});

afterAll(async () => {
  // tear down test database
  await app.close();
});
```

## Test vs prod config को अलग करें

अलग database के साथ `.env.test` का उपयोग करें; आपका CI इसे पढ़ सकता है और हर test run के लिए clean DB spin up कर सकता है।
