Skip to content

Commit

Permalink
Merge pull request #86 from optii/validate_functions
Browse files Browse the repository at this point in the history
Validate functions with joi
  • Loading branch information
augnin authored Nov 21, 2018
2 parents 3c73675 + 3b14b13 commit 391984b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ internals.alternatives = internals.Joi.lazy(() => {
internals.Joi.string().allow(''),
internals.Joi.number(),
internals.Joi.boolean(),
internals.Joi.array()
internals.Joi.array(),
internals.Joi.func()
]);
});

Expand Down
6 changes: 6 additions & 0 deletions test/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ describe('validate()', () => {
const err = Confidence.Store.validate(undefined);
expect(err).to.equal(null);
});

it('returns null with function in a node', () => {

const err = Confidence.Store.validate({ func: () => {} });
expect(err).to.equal(null);
});
});

describe('_logApplied', () => {
Expand Down

0 comments on commit 391984b

Please sign in to comment.