Skip to content

Commit 428d9f2

Browse files
committed
Start with model testing.
🔊 I need some help here. I'll open an issue, so somebody might help me with this test.
1 parent 5470d8a commit 428d9f2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec/validators/model.spec.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
/**
3+
* How do I test this?
4+
*
5+
* Since Model validator is a very close to the core validator, and it needs
6+
* the validator to be running on top of a "modelate" object, I don't know how
7+
* to test this in an appropiate way.
8+
*
9+
* Lot of things to think about.
10+
*/
11+
12+
const valid = require('../../lib/validators/model');
13+
14+
describe(' - Model validator', () => {
15+
it('shall be a function', () => {
16+
expect(typeof valid).toEqual('function');
17+
});
18+
19+
it('shall not validate a inexistent model', () => {
20+
const resp = valid({name: ''}, {model: 'MyTestModel'});
21+
expect(resp).toEqual(false);
22+
});
23+
24+
});

0 commit comments

Comments
 (0)