Skip to content

Commit be85887

Browse files
committed
增加测试用例
1 parent 542cc7b commit be85887

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/we-validator.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ describe('testing: we-validator package', () => {
88
expect(WeValidator.checkValue('required', '')).to.not.be.ok
99
expect(WeValidator.checkValue('chinese', '好的')).to.be.ok
1010
expect(WeValidator.checkValue('chinese', 'a')).to.not.be.ok
11+
expect(WeValidator.checkValue('mobile', '')).to.not.be.ok
12+
expect(WeValidator.checkValue('mobile', '111')).to.not.be.ok
13+
expect(WeValidator.checkValue('mobile', '15111111111')).to.be.ok
1114
})
1215

1316
it('testing: addRule', () => {
@@ -18,6 +21,7 @@ describe('testing: we-validator package', () => {
1821
})
1922
expect(WeValidator.checkValue('theRuleName', '1')).to.be.ok
2023
expect(WeValidator.checkValue('theRuleName', 'a')).to.not.be.ok
24+
expect(WeValidator.checkValue('theRuleName', '')).to.not.be.ok
2125
})
2226

2327
it('testing: onMessage global', () => {

0 commit comments

Comments
 (0)