Skip to content

Commit 6500068

Browse files
fix failing test re: Automattic#5078 Automattic#9010
1 parent f814ff8 commit 6500068

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/helpers/document/compile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function getOwnPropertyDescriptors(object) {
195195
return;
196196
}
197197
result[key].enumerable = [
198+
'$isNew',
198199
'isNew',
199200
'$__',
200201
'errors',

test/document.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4903,7 +4903,7 @@ describe('document', function() {
49034903
});
49044904

49054905
schema.virtual('tests').get(function() {
4906-
return Object.keys(this.nested).map(key => this.nested[key]);
4906+
return Object.values(this.nested);
49074907
});
49084908

49094909
const M = db.model('Test', schema);

test/schema.test.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,11 +1449,6 @@ describe('schema', function() {
14491449
});
14501450
}, /`collection` may not be used as a schema pathname/);
14511451

1452-
assert.throws(function() {
1453-
new Schema({
1454-
isNew: String
1455-
});
1456-
}, /`isNew` may not be used as a schema pathname/);
14571452

14581453
assert.throws(function() {
14591454
new Schema({
@@ -1466,6 +1461,10 @@ describe('schema', function() {
14661461
new Schema({
14671462
init: String
14681463
});
1464+
1465+
new Schema({
1466+
isNew: String
1467+
});
14691468
});
14701469

14711470
it('that do not conflict do not throw', function(done) {

0 commit comments

Comments
 (0)