2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-27 14:47:43 +03:00
Files
axios/test/unit/helpers/parseHeaders.js
T
2014-09-22 11:12:24 -06:00

19 lines
587 B
JavaScript

var parseHeaders = require('../../../lib/helpers/parseHeaders');
module.exports = {
testParse: function (test) {
var date = new Date();
var parsed = parseHeaders(
'Date: ' + date.toISOString() + '\n' +
'Content-Type: application/json\n' +
'Connection: keep-alive\n' +
'Transfer-Encoding: chunked'
);
test.equals(parsed['date'], date.toISOString());
test.equals(parsed['content-type'], 'application/json');
test.equals(parsed['connection'], 'keep-alive');
test.equals(parsed['transfer-encoding'], 'chunked');
test.done();
}
};