Skip to content

Commit

Permalink
Merge pull request #27 from junaidrahim/add-testing
Browse files Browse the repository at this point in the history
Add testing for isURL()
  • Loading branch information
saurabhdaware authored Oct 8, 2019
2 parents e483146 + 0dae049 commit bc0ac3f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/helper.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { isURL } = require('../lib/helper')

const expect = require('chai').expect;

describe('helper', ()=> {

it('isURL()', () => {
// Links
expect(isURL("https://www.google.com")).to.be.true
expect(isURL("https://www.data.gov.in")).to.be.true
expect(isURL("http://facebook.com")).to.be.true
expect(isURL("http://github.com")).to.be.true

// Not Links
expect(isURL("helloworld")).to.be.false
expect(isURL("htts://www.google.com")).to.be.false
expect(isURL("hats://facebook")).to.be.false
expect(isURL("blablabla.com")).to.be.false
});

})

0 comments on commit bc0ac3f

Please sign in to comment.