| 121 | mockReq.headers["content-type"] = "application/x-www-form-urlencoded"; |
| 122 | mockReq.body = "key=value&foo=bar"; |
| 123 | const formParser = body => { |
| 124 | const result = {}; |
| 125 | body.split("&").forEach(pair => { |
| 126 | const [key, value] = pair.split("="); |
| 127 | result[key] = value; |
| 128 | }); |
| 129 | |
| 130 | return result; |
| 131 | }; |
| 132 | mockReq.server.parsers.set("application/x-www-form-urlencoded", formParser); |
| 133 | |
| 134 | parse(mockReq, mockRes, mockNext); |
no outgoing calls
no test coverage detected