fix(http): check response body text against undefined (#13017)

This commit is contained in:
domusofsail
2016-12-10 00:39:39 +01:00
committed by Victor Berchet
parent 8db184d349
commit f106a18b96
2 changed files with 10 additions and 1 deletions

View File

@ -88,5 +88,14 @@ export function main() {
expect(req.text()).toEqual('');
});
it('should return empty string if body is undefined', () => {
const reqOptions = new RequestOptions(
{url: 'test', method: 'GET', headers: new Headers({'content-type': 'application/json'})});
delete reqOptions.body;
const req = new Request(reqOptions);
expect(req.text()).toEqual('');
});
});
}