Skip to content

Commit 9b4a323

Browse files
committed
test(schema): repro #8219
1 parent fb66f3a commit 9b4a323

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/schema.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -2126,4 +2126,13 @@ describe('schema', function() {
21262126
const testKo = new TestKo({field: 'upper'});
21272127
assert.equal(testKo.field, 'UPPER');
21282128
});
2129+
2130+
it('required with nullish value (gh-8219)', function() {
2131+
const schema = Schema({
2132+
name: { type: String, required: void 0 },
2133+
age: { type: Number, required: null }
2134+
});
2135+
assert.strictEqual(schema.path('name').isRequired, false);
2136+
assert.strictEqual(schema.path('age').isRequired, false);
2137+
});
21292138
});

0 commit comments

Comments
 (0)