File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export class TypeMetadataStorageHost {
88 private properties = new Array < PropertyMetadata > ( ) ;
99
1010 addPropertyMetadata ( metadata : PropertyMetadata ) {
11- this . properties . push ( metadata ) ;
11+ this . properties . unshift ( metadata ) ;
1212 }
1313
1414 addSchemaMetadata ( metadata : SchemaMetadata ) {
Original file line number Diff line number Diff line change @@ -84,6 +84,26 @@ class ExampleClass {
8484describe ( 'DefinitionsFactory' , ( ) => {
8585 it ( 'should generate a valid schema definition' , ( ) => {
8686 const definition = DefinitionsFactory . createForClass ( ExampleClass ) ;
87+
88+ expect ( Object . keys ( definition ) ) . toEqual ( [
89+ 'objectId' ,
90+ 'name' ,
91+ 'buffer' ,
92+ 'decimal' ,
93+ 'mixed' ,
94+ 'expiresAt' ,
95+ 'map' ,
96+ 'isEnabled' ,
97+ 'number' ,
98+ 'ref' ,
99+ 'child' ,
100+ 'child2' ,
101+ 'nodes' ,
102+ 'customArray' ,
103+ 'customObject' ,
104+ 'any' ,
105+ 'array' ,
106+ ] ) ;
87107 expect ( definition ) . toEqual ( {
88108 objectId : {
89109 type : mongoose . Schema . Types . ObjectId ,
You can’t perform that action at this time.
0 commit comments