Skip to content

Commit 7352758

Browse files
committed
Add a new test to model validator
Still untested
1 parent 758be80 commit 7352758

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

spec/validators/model.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,25 @@
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

1419
describe(' - 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
});

0 commit comments

Comments
 (0)