2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-20 20:00:40 +03:00

Use different socket for Win32 test (#3375)

* Remove the skipping of the `socket` http test

* Use different socket path for Win32

 - See: https://github.com/nodejs/node-v0.x-archive/blob/master/test/simple/test-pipe-stream.js#L73
 - Also: https://github.com/nodejs/node-v0.x-archive/blob/master/test/common.js#L39

* Updating axios in types to be lower case (#2797)

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>

Co-authored-by: Pilot <timemachine@ctrl-c.club>
Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
Daniel Lopretto
2020-12-09 06:04:58 -05:00
committed by GitHub
parent e426910be7
commit 8b0f373df0
+9 -2
View File
@@ -370,13 +370,20 @@ describe('supports http with nodejs', function () {
}); });
it('should support sockets', function (done) { it('should support sockets', function (done) {
// Different sockets for win32 vs darwin/linux
var socketName = './test.sock';
if (process.platform === 'win32') {
socketName = '\\\\.\\pipe\\libuv-test';
}
server = net.createServer(function (socket) { server = net.createServer(function (socket) {
socket.on('data', function () { socket.on('data', function () {
socket.end('HTTP/1.1 200 OK\r\n\r\n'); socket.end('HTTP/1.1 200 OK\r\n\r\n');
}); });
}).listen('./test.sock', function () { }).listen(socketName, function () {
axios({ axios({
socketPath: './test.sock', socketPath: socketName,
url: '/' url: '/'
}) })
.then(function (resp) { .then(function (resp) {