File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ diff --git a/test/model.test.js b/test/model.test.js
2+ index dd944d341..b4386a4ee 100644
3+ --- a/test/model.test.js
4+ +++ b/test/model.test.js
5+ @@ -9165,31 +9165,6 @@ describe('Model', function() {
6+ assert.strictEqual(doc.name, 'Test2');
7+ });
8+ });
9+ - describe('gh-15812', function() {
10+ - it('should throw ObjectParameterError when init is called with null', function() {
11+ - const doc = new mongoose.Document({}, new mongoose.Schema({ name: String }));
12+ - try {
13+ - doc.init(null);
14+ - assert.fail('Should have thrown an error');
15+ - } catch (error) {
16+ - assert.ok(error instanceof ObjectParameterError);
17+ - assert.strictEqual(error.name, 'ObjectParameterError');
18+ - assert.ok(error.message.includes('Parameter "doc" to init() must be an object'));
19+ - }
20+ - });
21+ -
22+ - it('should throw ObjectParameterError when init is called with undefined', function() {
23+ - const doc = new mongoose.Document({}, new mongoose.Schema({ name: String }));
24+ - try {
25+ - doc.init(undefined);
26+ - assert.fail('Should have thrown an error');
27+ - } catch (error) {
28+ - assert.ok(error instanceof ObjectParameterError);
29+ - assert.strictEqual(error.name, 'ObjectParameterError');
30+ - assert.ok(error.message.includes('Parameter "doc" to init() must be an object'));
31+ - }
32+ - });
33+ - });
34+ });
35+
36+
You can’t perform that action at this time.
0 commit comments