mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
20 lines
628 B
JavaScript
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');
|
|
});
|
|
});
|
|
|