* Setup.
(schema)
| 21 | */ |
| 22 | |
| 23 | function TestDoc(schema) { |
| 24 | const Subdocument = function() { |
| 25 | ArraySubdocument.call(this, {}, new DocumentArray()); |
| 26 | }; |
| 27 | |
| 28 | /** |
| 29 | * Inherits from ArraySubdocument. |
| 30 | */ |
| 31 | |
| 32 | Object.setPrototypeOf(Subdocument.prototype, ArraySubdocument.prototype); |
| 33 | |
| 34 | /** |
| 35 | * Set schema. |
| 36 | */ |
| 37 | |
| 38 | const SubSchema = new Schema({ |
| 39 | title: { type: String } |
| 40 | }); |
| 41 | |
| 42 | Subdocument.prototype.$__setSchema(idGetter(schema || SubSchema)); |
| 43 | |
| 44 | return Subdocument; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Test. |
no test coverage detected