hash: '#hash',
query: {},
})
+ expect(parseURL('/foo#hash')).toEqual({
+ fullPath: '/foo#hash',
+ path: '/foo',
+ hash: '#hash',
+ query: {},
+ })
expect(parseURL('/foo?')).toEqual({
fullPath: '/foo?',
path: '/foo',
hash: '',
query: {},
})
+ expect(parseURL('/foo')).toEqual({
+ fullPath: '/foo',
+ path: '/foo',
+ hash: '',
+ query: {},
+ })
})
it('works with empty hash', () => {
hash: '#',
query: {},
})
+ expect(parseURL('/foo')).toEqual({
+ fullPath: '/foo',
+ path: '/foo',
+ hash: '',
+ query: {},
+ })
})
it('works with a relative paths', () => {
hash: '',
query: {},
})
+ // cannot go below root
+ expect(parseURL('../../foo', '/parent/bar')).toEqual({
+ fullPath: '/foo',
+ path: '/foo',
+ hash: '',
+ query: {},
+ })
+ expect(parseURL('', '/parent/bar')).toEqual({
+ fullPath: '/parent/bar',
+ path: '/parent/bar',
+ hash: '',
+ query: {},
+ })
expect(parseURL('#foo', '/parent/bar')).toEqual({
fullPath: '/parent/bar#foo',
path: '/parent/bar',