-
-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from ChALkeR/chalker/fix-undef
Fix 'required' implementation
- Loading branch information
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const tape = require('tape') | ||
const validator = require('..') | ||
|
||
tape('required + uniqueItems', (t) => { | ||
const validate = validator({ required: ['a'], uniqueItems: true }) | ||
t.notOk(validate([1, 1]), 'required + uniqueItems') | ||
t.end() | ||
}) | ||
|
||
tape('required + uniqueItems inside allOf', (t) => { | ||
const validate = validator({ | ||
required: ['a'], | ||
allOf: [ | ||
{ required: ['b'], uniqueItems: true } | ||
] | ||
}) | ||
t.notOk(validate([1, 1]), 'required + uniqueItems in allOf') | ||
t.end() | ||
}) |