Skip to content

Commit

Permalink
test(schema): repro #8292
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Nov 6, 2019
1 parent 328f94e commit 081f2ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/schema.test.js
Expand Up @@ -2144,4 +2144,14 @@ describe('schema', function() {
filter(key => ['constructor', 'cast', 'castForQuery', 'checkRequired'].indexOf(key) === -1);
assert.deepEqual(keys.sort(), functions.sort());
});

it('supports passing schema options to `Schema#path()` (gh-8292)', function() {
const schema = Schema({ title: String });
const path = schema.path('title');

const newSchema = Schema({});
newSchema.add({ title: path.options });

assert.equal(newSchema.path('title').options.type, String);
});
});

0 comments on commit 081f2ec

Please sign in to comment.