mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
feat: extend api request builder with custom base url
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ca586413d2
commit
8977100830
5 changed files with 26 additions and 4 deletions
|
@ -18,6 +18,12 @@ describe('DeleteApiRequestBuilder', () => {
|
|||
afterAll(() => {
|
||||
global.fetch = originalFetch
|
||||
})
|
||||
|
||||
it('uses the custom base url as prefix', async () => {
|
||||
expectFetch('https://example.org/api/private/test', 200, { method: 'DELETE' })
|
||||
await new DeleteApiRequestBuilder<string>('test', 'https://example.org/').sendRequest()
|
||||
})
|
||||
|
||||
describe('sendRequest without body', () => {
|
||||
it('without headers', async () => {
|
||||
expectFetch('api/private/test', 204, { method: 'DELETE' })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue