1 |
|
2 |
|
3 | class RequestMock {
|
4 | constructor () {
|
5 | this.body = Buffer.alloc(10)
|
6 | this.url = '/search?query=cutie+rest'
|
7 | this.headers = {
|
8 | 'content-length': '1'
|
9 | }
|
10 | }
|
11 | on (eventName, callback) {
|
12 | if (eventName === 'data') {
|
13 | callback(Buffer.alloc(1))
|
14 | } else if (eventName === 'end') {
|
15 | callback()
|
16 | }
|
17 | }
|
18 | write () {}
|
19 | }
|
20 |
|
21 | module.exports = RequestMock
|