mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-30 00:57:04 +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>
|
<summary><strong>Javascript</strong></summary>
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
const request = require('supertest');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/user', (req, res) => {
|
app.get('/user', (req, res) => {
|
||||||
@ -79,6 +80,7 @@ request(app)
|
|||||||
<summary><strong>Typescript</strong></summary>
|
<summary><strong>Typescript</strong></summary>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
const request = require('supertest');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/user', (req: Request, res: Response) => {
|
app.get('/user', (req: Request, res: Response) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user