2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-24 14:04:14 +03:00
Files
axios/test/specs/helpers/parseHeaders.spec.js
T
2015-03-18 17:12:51 -06:00

20 lines
628 B
JavaScript

var parseHeaders = require('../../../lib/helpers/parseHeaders');
describe('helpers::parseHeaders', function () {
it('should parse headers', function () {
var date = new Date();
var parsed = parseHeaders(
'Date: ' + date.toISOString() + '\n' +
'Content-Type: application/json\n' +
'Connection: keep-alive\n' +
'Transfer-Encoding: chunked'
);
expect(parsed['date']).toEqual(date.toISOString());
expect(parsed['content-type']).toEqual('application/json');
expect(parsed['connection']).toEqual('keep-alive');
expect(parsed['transfer-encoding']).toEqual('chunked');
});
});