Fixed tests and some undefined value handling.
This commit is contained in:
@@ -212,6 +212,9 @@ Schema.prototype.validateObject = function(className, object) {
|
|||||||
var geocount = 0;
|
var geocount = 0;
|
||||||
var promise = this.validateClassName(className);
|
var promise = this.validateClassName(className);
|
||||||
for (var key in object) {
|
for (var key in object) {
|
||||||
|
if (object[key] === undefined) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
var expected = getType(object[key]);
|
var expected = getType(object[key]);
|
||||||
if (expected === 'geopoint') {
|
if (expected === 'geopoint') {
|
||||||
geocount++;
|
geocount++;
|
||||||
|
|||||||
@@ -1336,7 +1336,7 @@ describe('Parse.User testing', () => {
|
|||||||
var b = JSON.parse(body);
|
var b = JSON.parse(body);
|
||||||
expect(b.results.length).toEqual(1);
|
expect(b.results.length).toEqual(1);
|
||||||
var user = b.results[0];
|
var user = b.results[0];
|
||||||
expect(Object.keys(user).length).toEqual(5);
|
expect(Object.keys(user).length).toEqual(6);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ function transformAtom(atom, force, options) {
|
|||||||
return atom;
|
return atom;
|
||||||
|
|
||||||
case 'undefined':
|
case 'undefined':
|
||||||
|
return atom;
|
||||||
case 'symbol':
|
case 'symbol':
|
||||||
case 'function':
|
case 'function':
|
||||||
throw new Parse.Error(Parse.Error.INVALID_JSON,
|
throw new Parse.Error(Parse.Error.INVALID_JSON,
|
||||||
|
|||||||
Reference in New Issue
Block a user