Skip to content

Commit 034c169

Browse files
committed
add TS compile test
1 parent e930a27 commit 034c169

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/typescript/index.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ const Validator: typeof ValidatorType = require('../../index'); // here we impor
66
describe('Typescript Definitions', () => {
77
it('should compile validator', async () => {
88
const v = new Validator();
9-
const compiled = v.compile({});
9+
const compiled = v.compile({
10+
id: { type: "number", min: 1, integer: true }
11+
});
1012

1113
expect(compiled).toBeInstanceOf(Function)
14+
15+
const res = compiled({
16+
id: 2
17+
});
18+
19+
expect(res).toBe(true);
1220
});
1321
});
1422

0 commit comments

Comments
 (0)