mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-29 00:19:14 +08:00
added require for the testing package
This commit is contained in:
@ -57,6 +57,7 @@ const server = http.createServer(app);
|
||||
<summary><strong>Javascript</strong></summary>
|
||||
|
||||
```javascript
|
||||
const request = require('supertest');
|
||||
const app = express();
|
||||
|
||||
app.get('/user', (req, res) => {
|
||||
@ -79,6 +80,7 @@ request(app)
|
||||
<summary><strong>Typescript</strong></summary>
|
||||
|
||||
```typescript
|
||||
const request = require('supertest');
|
||||
const app = express();
|
||||
|
||||
app.get('/user', (req: Request, res: Response) => {
|
||||
@ -95,4 +97,4 @@ request(app)
|
||||
});
|
||||
|
||||
```
|
||||
</details>
|
||||
</details>
|
||||
|
||||
Reference in New Issue
Block a user