diff options
Diffstat (limited to 'node_modules/stream-http/test/browser/post-text.js')
-rw-r--r-- | node_modules/stream-http/test/browser/post-text.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/node_modules/stream-http/test/browser/post-text.js b/node_modules/stream-http/test/browser/post-text.js deleted file mode 100644 index 1cea8d7a7..000000000 --- a/node_modules/stream-http/test/browser/post-text.js +++ /dev/null @@ -1,48 +0,0 @@ -var Buffer = require('buffer').Buffer -var fs = require('fs') -var test = require('tape') - -var http = require('../..') - -var reference = fs.readFileSync(__dirname + '/../server/static/basic.txt') - -test('post text', function (t) { - var req = http.request({ - path: '/echo', - method: 'POST' - }, function (res) { - var buffers = [] - - res.on('end', function () { - t.ok(reference.equals(Buffer.concat(buffers)), 'echoed contents match') - t.end() - }) - - res.on('data', function (data) { - buffers.push(data) - }) - }) - - req.write(reference) - req.end() -}) - -test('post text with data in end()', function (t) { - var req = http.request({ - path: '/echo', - method: 'POST' - }, function (res) { - var buffers = [] - - res.on('end', function () { - t.ok(reference.equals(Buffer.concat(buffers)), 'echoed contents match') - t.end() - }) - - res.on('data', function (data) { - buffers.push(data) - }) - }) - - req.end(reference) -})
\ No newline at end of file |