Skip to content

Commit

Permalink
Adding tests for method options type definitions (#1996)
Browse files Browse the repository at this point in the history
Update tests.

Co-authored-by: Xianming Zhong <chinesedfan@qq.com>
  • Loading branch information
grumblerchester and chinesedfan committed Mar 7, 2020
1 parent 42eb9df commit c98ce7d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/typescript/axios.ts
Expand Up @@ -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);
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c98ce7d

Please sign in to comment.