# [Stephen Grider] Microservices with Node JS and React [ENG, 2020]

# 10. Testing Isolated Microservices

<br/>

### 01. Scope of Testing

<br/>

### 02. Testing Goals

<br/>

![Application](/img/pic-10-01.png?raw=true)

<br/>

![Application](/img/pic-10-02.png?raw=true)

<br/>

![Application](/img/pic-10-03.png?raw=true)

<br/>

### 03. Testing Architecture

<br/>

![Application](/img/pic-10-04.png?raw=true)

<br/>

### 04. Index to App Refactor

<br/>

### 05. A Few Dependencies

    $ npm install --save-dev @types/jest @types/supertest jest ts-jest supertest mongodb-memory-server

<br/>

### 06. Test Environment Setup

<br/>

### 07. Our First Test

    $ cd auth
    $ npm run test

<br/>

### 08. An Important Note

<br/>

### 08. An Important Note

<br/>

### 09. Testing Invalid Input

<br/>

### 10. Requiring Unique Emails

<br/>

### 11. Changing Node Env During Tests

<br/>

### 12. Tests Around Sign In Functionality

<br/>

### 13. Testing Sign Out

<br/>

### 14. Issues with Cookies During Testing

<br/>

### 15. Easy Auth Solution

<br/>

### 16. Auth Helper Function

<br/>

### 17. Testing Non-Authed Requests

<br/>

![Application](/img/pic-10-05.png?raw=true)

<br/>

---

<br/>

**Marley**

Any questions in english: <a href="https://jsdev.org/chat/">Telegram Chat</a>  
Любые вопросы на русском: <a href="https://jsdev.ru/chat/">Телеграм чат</a>
