merge: Add ValidateUrl in String (#856)

* Add ValidateUrl in String

* change regex

* Bug fix
This commit is contained in:
YATIN KATHURIA
2021-12-02 16:23:54 +05:30
committed by GitHub
parent 961f21f97c
commit 6fb649e53d
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import { validateURL } from '../ValidateUrl'
describe('ValidateUrl', () => {
it('expects to return false', () => {
expect(validateURL('google')).toEqual(false)
expect(validateURL('link: https://www.google.com')).toEqual(false)
})
it('expects to return true', () => {
expect(validateURL('http://www.google.com')).toEqual(true)
expect(validateURL('https://www.google.com')).toEqual(true)
expect(validateURL('www.google.com')).toEqual(true)
})
})