license import * as chai from 'chai' ; import * as urlUtils from '../url-utils' ; const assert = chai . assert ; suite ( 'URL Utils' , ( ) => { suite ( 'stripUrlFileSearchAndHash' , ( ) => { test ( 'Strips "man.html" basename off URL' , ( ) => { assert . equal ( urlUtils . stripUrlFileSearchAndHash ( 'shark://alligator/man.html' ) , 'shark://alligator/' ) ; } ) ; test ( 'Strips "file.html" basename off URL' , ( ) => { assert . equal ( urlUtils . stripUrlFileSearchAndHash ( 'https://example.com/path/to/file.html' ) , 'https://example.com/path/to/' ) ; } ) ; test ( 'Strips "something?a=b&c=d" basename and search off URL' , ( ) => { assert . equal ( urlUtils . stripUrlFileSearchAndHash ( 'https://example.com/path/to/something?a=b&c=d' ) , 'https://example.com/path/to/' ) ; } ) ; test ( 'Strips "#some-hash-value" off URL' , ( ) => { assert . equal ( urlUtils . stripUrlFileSearchAndHash ( 'https://example.com/path/#some-hash-value' ) , 'https://example.com/path/' ) ; } ) ; test ( 'Handles relative paths' , ( ) => { assert . equal ( urlUtils . stripUrlFileSearchAndHash ( 'relative/path/to/file' ) , 'relative/path/to/' ) ; } ) ; } ) ; } ) ;