Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
schema.validate(source, function(err, res) {
expect(res.fields.name.length).to.eql(1);
expect(res.fields['address.name'].length).to.eql(1);
done();
});
});