Skip to content

Commit aa5af8e

Browse files
committed
prevValue tests: use Node 24 compatible assert
The prevValue tests used "nulls" in expected values. This comparison fails in Node 24, as the actual value is "undefined". However, the original value seems to be "undefined" in previous Node versions too. Therefore it does not seem like a change in behaviour, but only a change in how strict the assert is. Changing the expected value to "undefined" works in both Node 24 and previous Node versions.
1 parent a8aebad commit aa5af8e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/document.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,13 +1716,13 @@ describe('document', function() {
17161716
}
17171717
}));
17181718
const doc = new Model({ name: 'test', profile: { age: 29 } });
1719-
assert.deepEqual(names, [null]);
1720-
assert.deepEqual(profiles, [null]);
1719+
assert.deepEqual(names, [undefined]);
1720+
assert.deepEqual(profiles, [undefined]);
17211721

17221722
doc.name = 'test2';
17231723
doc.profile = { age: 30 };
1724-
assert.deepEqual(names, [null, 'test']);
1725-
assert.deepEqual(profiles, [null, { age: 29 }]);
1724+
assert.deepEqual(names, [undefined, 'test']);
1725+
assert.deepEqual(profiles, [undefined, { age: 29 }]);
17261726
});
17271727

17281728
describe('on nested paths', function() {

test/query.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3128,7 +3128,7 @@ describe('Query', function() {
31283128
const Model = db.model('Test', schema);
31293129

31303130
return Model.updateOne({}, { name: 'bar' }).exec().
3131-
then(() => assert.deepEqual(priorVals, [null]));
3131+
then(() => assert.deepEqual(priorVals, [undefined]));
31323132
});
31333133

31343134
describe('clone', function() {

0 commit comments

Comments
 (0)