2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-08 17:22:34 +03:00

Merge branch 'master' into instance-options

This commit is contained in:
Martti Laine
2018-03-02 12:32:47 +02:00
committed by GitHub
12 changed files with 84 additions and 17 deletions
+19
View File
@@ -1,5 +1,6 @@
var axios = require('../../../index');
var http = require('http');
var net = require('net');
var url = require('url');
var zlib = require('zlib');
var fs = require('fs');
@@ -228,6 +229,24 @@ module.exports = {
});
},
testSocket: function (test) {
server = net.createServer(function (socket) {
socket.on('data', function() {
socket.end('HTTP/1.1 200 OK\r\n\r\n');
});
}).listen('./test.sock', function() {
axios({
socketPath: './test.sock',
url: '/'
})
.then(function(resp) {
test.equal(resp.status, 200);
test.equal(resp.statusText, 'OK');
test.done();
});
});
},
testStream: function(test) {
server = http.createServer(function (req, res) {
req.pipe(res);