2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Adding test for compression error handling

This commit is contained in:
Nick Uraltsev
2016-05-18 19:47:12 -07:00
parent 94a2128549
commit 600653e293
+12
View File
@@ -102,6 +102,18 @@ module.exports = {
});
},
testGunzipErrorHandling: function (test) {
server = http.createServer(function (req, res) {
res.setHeader('Content-Type', 'application/json;charset=utf-8');
res.setHeader('Content-Encoding', 'gzip');
res.end('invalid response');
}).listen(4444, function () {
axios.get('http://localhost:4444/').catch(function (error) {
test.done();
});
});
},
testUTF8: function (test) {
var str = Array(100000).join('ж');