From a561e968de063bf4e922e14f90fb4a099cfddc63 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 30 Dec 2016 17:02:21 +0100 Subject: [PATCH] test --- test/transport.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/transport.js b/test/transport.js index 804a707a8..7c44eaef1 100644 --- a/test/transport.js +++ b/test/transport.js @@ -294,4 +294,22 @@ describe('Transport', function () { }); }); } + + describe('options', function () { + it('should accept an `extraHeaders` option for XMLHttpRequest in browser', function () { + var headers = { + 'X-Custom-Header-For-My-Project': 'my-secret-access-token', + 'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly' + }; + var socket = new eio.Socket({ + transportOptions: { + polling: { + extraHeaders: headers + } + } + }); + expect(socket.transport.name).to.be('polling'); + expect(socket.transport.extraHeaders).to.equal(headers); + }); + }); });