File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ // this test is run by Vows (as all files matching *test.js)
2+
3+ var vows = require ( 'vows' ) ,
4+ should = require ( 'should' ) ;
5+
6+ var createSchema = require ( '..' ) . createSchema ,
7+ config = require ( './config' ) ;
8+
9+ var schemaSimple = {
10+ type : 'string'
11+ } ;
12+
13+ vows . describe ( 'Object Default' ) . addBatch ( {
14+ 'when calling without an object' : {
15+ topic : function ( ) {
16+ var schema = createSchema ( schemaSimple ) ;
17+ try {
18+ schema . validate ( undefined ) ;
19+ this . callback ( null ) ;
20+ } catch ( err ) {
21+ this . callback ( err ) ;
22+ }
23+ } ,
24+ 'we get an error' : function ( err , result ) {
25+ should . exist ( err ) ;
26+ err . should . have . property ( 'message' , 'JSON object is undefined' ) ;
27+ should . not . exist ( result ) ;
28+ }
29+ }
30+ } ) . export ( module ) ;
You can’t perform that action at this time.
0 commit comments