2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-03 05:10:47 +00:00
nativefier/test/module/options/normalizeUrlSpec.js
Jia Hao Goh 8f78dd03af Update eslint and use Airbnb style
- Add `npm run lint:fix` command
- Cleanup inferIcon.js logic slightly
2017-04-29 22:52:12 +08:00

26 lines
812 B
JavaScript

import chai from 'chai';
import normalizeUrl from '../../../src/options/normalizeUrl';
const assert = chai.assert;
const expect = chai.expect;
describe('Normalize URL', () => {
describe('given a valid URL without a protocol', () => {
it('should allow the url', () => {
assert.equal(normalizeUrl('http://www.google.com'), 'http://www.google.com');
});
});
describe('given a valid URL without a protocol', () => {
it('should allow the url and prepend the HTTP protocol', () => {
assert.equal(normalizeUrl('www.google.com'), 'http://www.google.com');
});
});
describe('given an invalid URL', () => {
it('should throw an exception', () => {
expect(() => normalizeUrl('http://ssddfoo bar')).to.throw('Your Url: "http://ssddfoo bar" is invalid!');
});
});
});