mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +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)
|
||||
.catch(handleError);
|
||||
|
||||
axios.options('/user')
|
||||
.then(handleResponse)
|
||||
.catch(handleError);
|
||||
|
||||
axios.delete('/user')
|
||||
.then(handleResponse)
|
||||
.catch(handleError);
|
||||
@@ -125,6 +129,10 @@ axios.get<User>('/user', { params: { id: 12345 } })
|
||||
|
||||
axios.head<User>('/user')
|
||||
.then(handleUserResponse)
|
||||
.catch(handleError);
|
||||
|
||||
axios.options<User>('/user')
|
||||
.then(handleUserResponse)
|
||||
.catch(handleError);
|
||||
|
||||
axios.delete<User>('/user')
|
||||
@@ -165,6 +173,10 @@ axios.head<User, string>('/user')
|
||||
.then(handleStringResponse)
|
||||
.catch(handleError);
|
||||
|
||||
axios.options<User, string>('/user')
|
||||
.then(handleStringResponse)
|
||||
.catch(handleError);
|
||||
|
||||
axios.delete<User, string>('/user')
|
||||
.then(handleStringResponse)
|
||||
.catch(handleError);
|
||||
@@ -209,6 +221,10 @@ instance1.get('/user?id=12345')
|
||||
.then(handleResponse)
|
||||
.catch(handleError);
|
||||
|
||||
instance1.options('/user')
|
||||
.then(handleResponse)
|
||||
.catch(handleError);
|
||||
|
||||
instance1.get('/user', { params: { id: 12345 } })
|
||||
.then(handleResponse)
|
||||
.catch(handleError);
|
||||
|
||||
Reference in New Issue
Block a user