From 9b4a323e09b7c8a51797246e142148ea765ef48f Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 7 Oct 2019 14:51:58 -0400 Subject: [PATCH] test(schema): repro #8219 --- test/schema.test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/schema.test.js b/test/schema.test.js index 2cc470bf24c..02c6c22baa9 100644 --- a/test/schema.test.js +++ b/test/schema.test.js @@ -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); + }); });