import { relativeToAbsolute } from './relative_to_absolute' ; describe ( 'relativeToAbsolute' , ( ) => { it ( 'converts a relative path to an absolute url' , ( ) => { const origin = window . location . origin ; expect ( relativeToAbsolute ( 'path' ) ) . toEqual ( `${ origin }/path` ) ; expect ( relativeToAbsolute ( '/path#hash' ) ) . toEqual ( `${ origin }/path#hash` ) ; expect ( relativeToAbsolute ( '/path?query=foo' ) ) . toEqual ( `${ origin }/path?query=foo` ) ; } ) ; } ) ;