Skip to content

Commit

Permalink
fix type: missing query param multi-value definition (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
juriwiens authored Mar 26, 2020
1 parent e5a16a0 commit 7f003d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ declare namespace LightMyRequest {
protocal?: string
hostname?: string
port?: string | number
query?: string | { [k: string]: string }
query?: string | { [k: string]: string | string[] }
}
path?: string | {
pathname: string
protocal?: string
hostname?: string
port?: string | number
query?: string | { [k: string]: string }
query?: string | { [k: string]: string | string[] }
}
headers?: http.IncomingHttpHeaders | http.OutgoingHttpHeaders
query?: string | { [k: string]: string }
query?: string | { [k: string]: string | string[] }
simulate?: {
end: boolean,
split: boolean,
Expand Down
8 changes: 8 additions & 0 deletions test/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ inject(dispatch, { method: 'get', url: '/', query: { name1: 'value1', value2: 'v
console.log(res.cookies)
})

inject(dispatch, { method: 'get', url: '/', query: { name1: ['value1', 'value2'] } }, (err, res) => {
expectType<Error>(err)
expectType<Response>(res)
console.log(res.payload)
expectType<Function>(res.json)
console.log(res.cookies)
})

inject(dispatch)
.get('/')
.end((err, res) => {
Expand Down

0 comments on commit 7f003d8

Please sign in to comment.