Skip to content

Commit

Permalink
test(schema): repro #4620
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 11, 2016
1 parent 1565cae commit 1f9e277
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/schema.test.js
Expand Up @@ -1647,5 +1647,13 @@ describe('schema', function() {
mongoose.model('gh4551', this.schema);
done();
});

it('handles default value = 0 (gh-4620)', function(done) {
var schema = new Schema({
tags: { type: [Number], default: 0 }
});
assert.deepEqual(schema.path('tags').getDefault().toObject(), [0]);
done();
});
});
});

0 comments on commit 1f9e277

Please sign in to comment.