Skip to content

Commit fa53627

Browse files
Fix lint error
1 parent fcafd64 commit fa53627

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

noformat.diff

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+

0 commit comments

Comments
 (0)