Skip to content

Commit b3bfd8a

Browse files
committed
added test for string and added text plain handling just in cause
1 parent a25409c commit b3bfd8a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/helper/response-handler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function wrapCallback(cb, options) {
5252
return cb(errObj);
5353
}
5454

55-
if (data.type && data.type === 'text/html') {
55+
if (data.type && (data.type === 'text/html' || data.type === 'text/plain')) {
5656
return cb(null, data.text);
5757
}
5858

test/helper/object.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,18 @@ describe('helpers', function () {
420420
});
421421
});
422422

423+
it.only('should not breack the string', function () {
424+
var object = "some random string";
425+
426+
var newObject = objectHelper.toCamelCase(object);
427+
428+
expect(object).to.eql("some random string");
429+
430+
expect(newObject).to.be.a('string');
431+
432+
expect(newObject).to.eql("some random string");
433+
});
434+
423435
it('should change the casing to all the attributes that are not blacklisted', function () {
424436
var object = {
425437
attr_name_1: 'attribute_1',

0 commit comments

Comments
 (0)