Skip to content

Commit bc0ac3f

Browse files
Merge pull request #27 from junaidrahim/add-testing
Add testing for isURL()
2 parents e483146 + 0dae049 commit bc0ac3f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/helper.spec.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { isURL } = require('../lib/helper')
2+
3+
const expect = require('chai').expect;
4+
5+
describe('helper', ()=> {
6+
7+
it('isURL()', () => {
8+
// Links
9+
expect(isURL("https://www.google.com")).to.be.true
10+
expect(isURL("https://www.data.gov.in")).to.be.true
11+
expect(isURL("http://facebook.com")).to.be.true
12+
expect(isURL("http://github.com")).to.be.true
13+
14+
// Not Links
15+
expect(isURL("helloworld")).to.be.false
16+
expect(isURL("htts://www.google.com")).to.be.false
17+
expect(isURL("hats://facebook")).to.be.false
18+
expect(isURL("blablabla.com")).to.be.false
19+
});
20+
21+
})

0 commit comments

Comments
 (0)