Skip to content

Commit

Permalink
test(schema): repro #8219
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Oct 7, 2019
1 parent fb66f3a commit 9b4a323
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2126,4 +2126,13 @@ describe('schema', function() {
const testKo = new TestKo({field: 'upper'});
assert.equal(testKo.field, 'UPPER');
});

it('required with nullish value (gh-8219)', function() {
const schema = Schema({
name: { type: String, required: void 0 },
age: { type: Number, required: null }
});
assert.strictEqual(schema.path('name').isRequired, false);
assert.strictEqual(schema.path('age').isRequired, false);
});
});

0 comments on commit 9b4a323

Please sign in to comment.