File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 99 * Lot of things to think about.
1010 */
1111
12- const valid = require ( '../../lib/validators/model' ) ;
12+ // const valid = require('../../lib/validators/model');
13+
14+ const validate = {
15+ valid : require ( '../../lib/validators/model' )
16+ } ;
17+ const valid = validate . valid ;
1318
1419describe ( ' - Model validator' , ( ) => {
1520 it ( 'shall be a function' , ( ) => {
1621 expect ( typeof valid ) . toEqual ( 'function' ) ;
1722 } ) ;
1823
24+ it ( 'shall return true if no model passed' , ( ) => {
25+ const resp = valid ( { name : '' } , { } ) ;
26+ expect ( resp ) . toEqual ( true ) ;
27+ } ) ;
28+
1929 it ( 'shall not validate a inexistent model' , ( ) => {
2030 const resp = valid ( { name : '' } , { model : 'MyTestModel' } ) ;
2131 expect ( resp ) . toEqual ( false ) ;
2232 } ) ;
23-
2433} ) ;
You can’t perform that action at this time.
0 commit comments