@francomelandri/url-builder
v1.0.2
Published
url builder
Downloads
1
Readme
url-builder
Small node package to build an URL starting form a template like this:
{{protocol}}://{{host}}/{{isocode}}/{{path}}
How to use:
test('should return url with query string parameter', () => {
let url = sut()
.withHost('www.example.com')
.withIso('it')
.withPath('/login')
.withQueryParameter('returnUrl', '/')
.build();
expect(url).toBe('https://www.example.com/it/login?returnUrl=/');
});
To run the test:
> npm test