(result)
| 128 | .send(`another client is withdrawing this ID [${key}]`); |
| 129 | } |
| 130 | const callback = function (result) { |
| 131 | if (result === undefined) { |
| 132 | // This happens when tearDown is called but no request |
| 133 | // of given ID has been received yet. |
| 134 | res.status(404).send(`Request of given ID not found: [${key}]`); |
| 135 | } else { |
| 136 | res.json({ |
| 137 | headers: result.headers, |
| 138 | body: result.body, |
| 139 | url: result.url, |
| 140 | }); |
| 141 | } |
| 142 | delete bank[req.params.bid][key]; |
| 143 | }; |
| 144 | if (result) { |
| 145 | callback(result); |
| 146 | } else { |
no test coverage detected