-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add test for createREquestUrl util
- Loading branch information
1 parent
47321f4
commit 657f972
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...ages/@ackee/antonio-core/src/modules/request/utils/url/__tests__/createRequestUrl.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import logger from 'loglevel'; | ||
import { createRequestUrl } from '..'; | ||
|
||
describe('createRequestUrl', () => { | ||
it('composes request url', () => { | ||
const url = createRequestUrl( | ||
'/user/:id', | ||
{ | ||
baseURL: 'https://example.com', | ||
uriParams: { | ||
id: '2', | ||
}, | ||
params: new URLSearchParams({ | ||
page: '1', | ||
}), | ||
headers: {}, | ||
}, | ||
{ | ||
logger, | ||
}, | ||
); | ||
|
||
expect(url).toBe('https://example.com/user/2?page=1'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters