node-convict
node-convict copied to clipboard
Error thrown if Object type default value has a property with a period
This test case fails:
diff --git a/test/validation-tests.js b/test/validation-tests.js
index d3a3dfe..45f7dcd 100644
--- a/test/validation-tests.js
+++ b/test/validation-tests.js
@@ -239,4 +239,19 @@ describe('schema contains an object property with a custom format', function() {
config.validate({ allowed: 'strict' });
}).must.not.throw();
});
+ it("must not throw if an object's default value property name contains a period", function() {
+ (function() {
+ const config = convict({
+ object: {
+ doc: 'default value contains property name that contains a period',
+ format: Object,
+ default: {
+ 'foo.bar': ''
+ }
+ }
+ });
+
+ config.validate();
+ }).must.not.throw();
+ });
});
blocks mozilla/fxa-content-server#6445
@madarche i think this was fixed in https://github.com/mozilla/node-convict/pull/269 ?
@vladikoff at the time of the last release, when I was filling the release notes, I had seen @shane-tomlinson's ticket and checked it against #269. I should have written about it in this ticket. Sorry. Unfortunately #269 doesn't solve Shane's provided test :disappointed:
With 55646f62003d61599a9f28e3fd8958a946d541fb I've just added Shane's test.
But I've skip-ped the test in the mocha tests so that the build is not shown as failed. But everyone can check for themselves that the provided test still fails: just remove the .skip string in the test description.
Duplicate/Similar to : #250