Skip to content

Commit

Permalink
Added tests for forbiddenKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed May 10, 2017
1 parent 18388ac commit 89d1c3e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/any.js
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,18 @@ describe('any', () => {
], done);
});
});
describe('forbiddenKeys()', () => {

it('should set keys as forbidden', (done) => {

const schema = Joi.object({ a: Joi.number().required(), b: Joi.number().required() }).forbiddenKeys('a', 'b');
Helper.validate(schema, [
[{}, true],
[{ a: undefined }, true],
[{ a: undefined, b: undefined }, true]
], done);
});
});

describe('empty()', () => {

Expand Down

0 comments on commit 89d1c3e

Please sign in to comment.