import { assert } from 'chai' ; import 'mocha' ; import { constructUrl } from '../../src/services/urls' ; describe ( 'Parsing - URLs - constructUrl()' , function ( ) : void { it ( 'returns a url from components' , function ( ) : void { const protocol = 'https' ; const hostname = 'example.com' ; const path = '/alice' ; const expectedUrl = 'https://example.com/alice' ; const actualUrl = constructUrl ( protocol , hostname , path ) ; assert . strictEqual ( actualUrl , expectedUrl ) ; } ) ; it ( 'returns a url with a port from components' , function ( ) : void { const protocol = 'https' ; const hostname = 'example.com' ; const path = '/alice' ; const port = '8080' ; const expectedUrl = 'https://example.com:8080/alice' ; const actualUrl = constructUrl ( protocol , hostname , path , port ) ; assert . strictEqual ( actualUrl , expectedUrl ) ; } ) ; } ) ;