Skip to content

Commit

Permalink
test(document): repro #7907
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 22, 2019
1 parent 5e7ab25 commit 41ad80a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/document.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7292,6 +7292,22 @@ describe('document', function() {
assert.equal(doc.nested.prop, '3');
});

it('supports setting date properties with strict: false (gh-7907)', function() {
const schema = Schema({}, { strict: false });
const SettingsModel = db.model('gh7907', schema);

const date = new Date();
const obj = new SettingsModel({
timestamp: date,
subDoc: {
timestamp: date
}
});

assert.strictEqual(obj.timestamp, date);
assert.strictEqual(obj.subDoc.timestamp, date);
});

it('handles .set() on doc array within embedded discriminator (gh-7656)', function() {
const pageElementSchema = new Schema({
type: { type: String, required: true }
Expand Down

0 comments on commit 41ad80a

Please sign in to comment.