Skip to content

Commit

Permalink
Some updates to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gfosco committed Feb 1, 2016
1 parent 5dc66fd commit 86e4297
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
13 changes: 0 additions & 13 deletions spec/transform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ describe('untransformObject', () => {
done();
});

it('null file', (done) => {
var input = {picture: null};
var output = transform.untransformObject(dummySchema, null, input);
expect(output.picture).toBeUndefined();
done();
});

it('geopoint', (done) => {
var input = {location: [180, -180]};
var output = transform.untransformObject(dummySchema, null, input);
Expand All @@ -131,12 +124,6 @@ describe('untransformObject', () => {
done();
});

it('null geopoint', (done) => {
var input = {location: null};
var output = transform.untransformObject(dummySchema, null, input);
expect(output.location).toBeUndefined();
done();
});
});

describe('transformKey', () => {
Expand Down
4 changes: 2 additions & 2 deletions transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ function untransformObject(schema, className, mongoObject) {
break;
} else if (key[0] == '_' && key != '__type') {
throw ('bad key in untransform: ' + key);
} else if (mongoObject[key] === null) {
break;
//} else if (mongoObject[key] === null) {
//break;
} else {
var expected = schema.getExpectedType(className, key);
if (expected == 'file') {
Expand Down

1 comment on commit 86e4297

@JordanVincent
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gfosco It looks like that line was needed. It introduced a bug #146, and null geopoints are still raising an exception. What's the reasoning behind that decision? Was it breaking other tests?

Please sign in to comment.