import getEnvelopeBody from '../getEnvelopeBody'; describe('request-helpers', () => { describe('getEnvelopeBody', () => { it('should correctly format request envelope body', () => { const method = 'GET'; const headers = { Authorization: 'super-secret-key', 'Content-type': 'nothing/useful', }; const body = { description: 'The body of the request', }; const expectedResult = JSON.stringify({ method, headers: { Authorization: ['super-secret-key'], 'Content-type': ['nothing/useful'], }, body, }); const result = getEnvelopeBody(method, headers, body); expect(result).toEqual(expectedResult); }); }); });