1 | const parseUrl = require('./parseUrl')
|
2 |
|
3 | describe('Transloadit/parseUrl', () => {
|
4 | it('splits a url into origin and pathname', () => {
|
5 | expect(parseUrl('http://api2.transloadit.com/ws2012')).toEqual({
|
6 | origin: 'http://api2.transloadit.com',
|
7 | pathname: '/ws2012'
|
8 | })
|
9 | })
|
10 |
|
11 | it('defaults to pathname=/ if absent', () => {
|
12 | expect(parseUrl('http://api2.transloadit.com')).toEqual({
|
13 | origin: 'http://api2.transloadit.com',
|
14 | pathname: '/'
|
15 | })
|
16 | })
|
17 | })
|