MCPcopy Create free account
hub / github.com/Automattic/mongoose / TestDoc

Function TestDoc

test/types.documentarray.test.js:23–45  ·  view source on GitHub ↗

* Setup.

(schema)

Source from the content-addressed store, hash-verified

21 */
22
23function 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.

Callers 1

Calls 1

idGetterFunction · 0.85

Tested by

no test coverage detected