You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
479 B
JavaScript
21 lines
479 B
JavaScript
import assert from 'assert';
|
|
import URL from 'url';
|
|
|
|
import validateUrl from './validate-url';
|
|
|
|
describe('validateUrl(parsedUrl)', () => {
|
|
it('returns false if url is not valid', () => {
|
|
const url = URL.parse('example.com');
|
|
const valid = validateUrl(url);
|
|
|
|
assert.equal(valid, false);
|
|
});
|
|
|
|
it('returns true if url is valid', () => {
|
|
const url = URL.parse('http://example.com');
|
|
const valid = validateUrl(url);
|
|
|
|
assert.equal(valid, true);
|
|
});
|
|
});
|