mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Adding tests for method options type definitions (#1996)
Update tests. Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
This commit is contained in:
@@ -78,6 +78,10 @@ axios.head('/user')
|
|||||||
.then(handleResponse)
|
.then(handleResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
|
|
||||||
|
axios.options('/user')
|
||||||
|
.then(handleResponse)
|
||||||
|
.catch(handleError);
|
||||||
|
|
||||||
axios.delete('/user')
|
axios.delete('/user')
|
||||||
.then(handleResponse)
|
.then(handleResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
@@ -125,6 +129,10 @@ axios.get<User>('/user', { params: { id: 12345 } })
|
|||||||
|
|
||||||
axios.head<User>('/user')
|
axios.head<User>('/user')
|
||||||
.then(handleUserResponse)
|
.then(handleUserResponse)
|
||||||
|
.catch(handleError);
|
||||||
|
|
||||||
|
axios.options<User>('/user')
|
||||||
|
.then(handleUserResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
|
|
||||||
axios.delete<User>('/user')
|
axios.delete<User>('/user')
|
||||||
@@ -165,6 +173,10 @@ axios.head<User, string>('/user')
|
|||||||
.then(handleStringResponse)
|
.then(handleStringResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
|
|
||||||
|
axios.options<User, string>('/user')
|
||||||
|
.then(handleStringResponse)
|
||||||
|
.catch(handleError);
|
||||||
|
|
||||||
axios.delete<User, string>('/user')
|
axios.delete<User, string>('/user')
|
||||||
.then(handleStringResponse)
|
.then(handleStringResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
@@ -209,6 +221,10 @@ instance1.get('/user?id=12345')
|
|||||||
.then(handleResponse)
|
.then(handleResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
|
|
||||||
|
instance1.options('/user')
|
||||||
|
.then(handleResponse)
|
||||||
|
.catch(handleError);
|
||||||
|
|
||||||
instance1.get('/user', { params: { id: 12345 } })
|
instance1.get('/user', { params: { id: 12345 } })
|
||||||
.then(handleResponse)
|
.then(handleResponse)
|
||||||
.catch(handleError);
|
.catch(handleError);
|
||||||
|
|||||||
Reference in New Issue
Block a user