fix export Bytes data type to JSON (#2409)

This commit is contained in:
CongHoang
2016-08-09 23:05:46 +07:00
committed by Florent Vilmart
parent 452887bd05
commit 6e0a25dea0
2 changed files with 33 additions and 3 deletions

View File

@@ -156,6 +156,18 @@ describe('parseObjectToMongoObjectForCreate', () => {
done();
});
it('bytes', (done) => {
var input = {binaryData: "aGVsbG8gd29ybGQ="};
var output = transform.mongoObjectToParseObject(null, input, {
fields: { binaryData: { type: 'Bytes' }},
});
expect(typeof output.binaryData).toEqual('object');
expect(output.binaryData).toEqual(
{__type: 'Bytes', base64: "aGVsbG8gd29ybGQ="}
);
done();
});
it('nested array', (done) => {
var input = {arr: [{_testKey: 'testValue' }]};
var output = transform.mongoObjectToParseObject(null, input, {