UNPKG

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