Skip to content

Commit

Permalink
Add URL formatting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud.dellinger committed Mar 15, 2019
1 parent f4bbc71 commit 8b33098
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/server/utils/__tests__/url.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as url from '../url';

describe('formatURL', () => {
it('should not prepend HTTP protocol', () => {
const rawURL = 'http://website.com';
const formatted = url.formatURL(rawURL);
expect(formatted).toEqual(rawURL);
});

it('should prepend HTTP protocol', () => {
const formatted = url.formatURL('website.com');
expect(formatted).toEqual('http://website.com');
});
});

0 comments on commit 8b33098

Please sign in to comment.