diff options
Diffstat (limited to 'node_modules/then-request/test/get-mock-response.js')
| -rw-r--r-- | node_modules/then-request/test/get-mock-response.js | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/node_modules/then-request/test/get-mock-response.js b/node_modules/then-request/test/get-mock-response.js deleted file mode 100644 index cb58c4d..0000000 --- a/node_modules/then-request/test/get-mock-response.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var assert = require('assert'); -var Response = require('http-response-object'); - -module.exports = getResponse; -function getResponse(method, url, headers, body, options) { - var isClient = options.isClient; - if (method === 'GET' && url === 'http://example.com') { - return new Response(200, {FoO: 'bar'}, 'body'); - } - if (method === 'GET' && url === 'http://example.com?foo=baz') { - return new Response(200, {FoO: 'baz'}, 'body'); - } - if (method === 'POST' && url === 'http://example.com') { - assert(headers['Content-Type'] === 'application/json'); - assert(JSON.parse(body.toString()).foo === 'baz'); - return new Response(200, {}, 'json body'); - } -} |