Skip to content

Commit

Permalink
test(schema): clean up messy tests re: #8459
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jan 8, 2020
1 parent 8fa8012 commit 1db031c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions test/schema.alias.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,14 @@ describe('schema alias option', function() {

var schema = new Schema({
nested: {
type: {
string: { type: String, alias: 'StringAlias' },
number: { type: Number, alias: 'NumberAlias' },
date: { type: Date, alias: 'DateAlias' },
buffer: { type: Buffer, alias: 'BufferAlias' },
boolean: { type: Boolean, alias: 'BooleanAlias' },
mixed: { type: Schema.Types.Mixed, alias: 'MixedAlias' },
objectId: { type: Schema.Types.ObjectId, alias: 'ObjectIdAlias'},
array: { type: [], alias: 'ArrayAlias' }
},
alias: 'NestedAlias'
string: { type: String, alias: 'StringAlias' },
number: { type: Number, alias: 'NumberAlias' },
date: { type: Date, alias: 'DateAlias' },
buffer: { type: Buffer, alias: 'BufferAlias' },
boolean: { type: Boolean, alias: 'BooleanAlias' },
mixed: { type: Schema.Types.Mixed, alias: 'MixedAlias' },
objectId: { type: Schema.Types.ObjectId, alias: 'ObjectIdAlias'},
array: { type: [], alias: 'ArrayAlias' }
}
});

Expand All @@ -84,7 +81,6 @@ describe('schema alias option', function() {
assert.ifError(err);

// Comparing with aliases
assert.equal(s.nested, s.NestedAlias);
assert.equal(s.nested.string, s.StringAlias);
assert.equal(s.nested.number, s.NumberAlias);
assert.equal(s.nested.date, s.DateAlias);
Expand Down

0 comments on commit 1db031c

Please sign in to comment.