|
@@ -1,5 +1,6 @@
|
|
|
import { describe, expect, test, beforeEach } from 'vitest'
|
|
import { describe, expect, test, beforeEach } from 'vitest'
|
|
|
import type { $Fetch } from 'nitropack'
|
|
import type { $Fetch } from 'nitropack'
|
|
|
|
|
+import type { FetchOptions } from 'ofetch'
|
|
|
import ApiRequestService from '~/services/data/apiRequestService'
|
|
import ApiRequestService from '~/services/data/apiRequestService'
|
|
|
import { HTTP_METHOD } from '~/types/enum/data'
|
|
import { HTTP_METHOD } from '~/types/enum/data'
|
|
|
import type { AssociativeArray } from '~/types/data'
|
|
import type { AssociativeArray } from '~/types/data'
|
|
@@ -114,7 +115,7 @@ describe('put', () => {
|
|
|
|
|
|
|
|
const result = await apiRequestService.put(
|
|
const result = await apiRequestService.put(
|
|
|
'https://myapi.com/api/item',
|
|
'https://myapi.com/api/item',
|
|
|
- 'request_body'
|
|
|
|
|
|
|
+ 'request_body',
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
expect(result).toEqual('a_response')
|
|
expect(result).toEqual('a_response')
|
|
@@ -155,9 +156,7 @@ describe('delete', () => {
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
apiRequestService.request = vi.fn(mockedRequestMethod)
|
|
apiRequestService.request = vi.fn(mockedRequestMethod)
|
|
|
|
|
|
|
|
- const result = await apiRequestService.delete(
|
|
|
|
|
- 'https://myapi.com/api/item'
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ const result = await apiRequestService.delete('https://myapi.com/api/item')
|
|
|
|
|
|
|
|
expect(result).toEqual('a_response')
|
|
expect(result).toEqual('a_response')
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|