()
| 805 | } |
| 806 | |
| 807 | function withCustomVersionKeyAndSchemaToObject() { |
| 808 | const ASchema = new Schema({ |
| 809 | testProperty: Number |
| 810 | }, { |
| 811 | versionKey: 'taco' as const, |
| 812 | toObject: { versionKey: false } |
| 813 | }); |
| 814 | |
| 815 | const AModel = model('YourModel', ASchema); |
| 816 | |
| 817 | const a = new AModel({ testProperty: 8 }); |
| 818 | |
| 819 | expect(a.toObject()).type.not.toHaveProperty('taco'); |
| 820 | expect(a.toJSON().taco).type.toBe<number>(); |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | function testFlattenUUIDs() { |