Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrià Sala committed Feb 14, 2024
1 parent 8f47625 commit 6211174
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/mongoose/test/unit/generateModel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('generateModel', () => {
}

class Customer {
@mgoose.prop({ type: [CustomerBirth] })
@mgoose.prop({ type: [CustomerBirth], default: [] })
birth: CustomerBirth[];

@mgoose.prop({ type: [String] })
Expand All @@ -85,10 +85,12 @@ describe('generateModel', () => {
const schema = mgoose.generateSchema(Customer, {});
expect(schema.obj).to.be.deep.equal({
birth: {
$type: [{ place: { $type: String } }]
$type: [{ place: { $type: String } }],
default: []
},
tags: {
$type: [String]
$type: [String],
default: undefined
}
});

Expand Down Expand Up @@ -196,11 +198,13 @@ describe('generateModel', () => {
expect(schema.obj).to.be.deep.equal({
profiles: {
required: true,
default: undefined,
$type: [
{
name: { $type: String },
phones: {
required: true,
default: undefined,
$type: [
{
type: { $type: String },
Expand Down

0 comments on commit 6211174

Please sign in to comment.