You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The headers in the request object passed into the callback for get or post mocks are getting lower-cased. While generally speaking, http headers are case-insensitive, it may actually matter for some http handling implementations.
import{defaultasrequest}from'superagent';importsuperagentMockerfrom'superagent-mocker';describe('making an api call',function(){beforeEach(function(done){constmock=this.mock=superagentMocker(request);constdata=this.data={someDataProp: 'data!'};mock.get('/api/some-url',(req)=>{// req.headers keys are all lowercased. They should not bethis.request=req;return{body: data};});constpromise=getData();promise.then(()=>done()).catch(done);});it('should have correct headers',function(){expect(this.request).to.have.deep.property('headers.Authorization','Bearer some token');});});
The text was updated successfully, but these errors were encountered:
The headers in the request object passed into the callback for
get
orpost
mocks are getting lower-cased. While generally speaking, http headers are case-insensitive, it may actually matter for some http handling implementations.The text was updated successfully, but these errors were encountered: