Skip to content

Add support for specifying custom query string serializer and make header assertion case insensitive

Choose a tag to compare

@github-actions github-actions released this 06 May 09:07
· 13 commits to 3.x since this release

The custom query string serializer could be used to specify how the query strings are serialized to a string before sending it in the request. For example:

import { stringify } from 'qs'
import { ApiRequest } from '@japa/api-client'

ApiRequest.setQsSerializer((value) => stringify(value))

test('send arrays in query string', ({ client }) => {
  await client
    .get('/')
    .qs('ids', ['1']) // send as Array
    .qs('usernames[]', 'virk') // send using array brackets in the key name
})

3.1.0 (2025-05-06)

Bug Fixes

  • normalize header name in assertHeader & assertHeaderMissing (#15) (6fd8c08)

Features

  • add support for specifying a custom query string serializer (1dc2334), closes #13

What's Changed

  • fix: normalize header name in assertHeader & assertHeaderMissing by @Vahelnir in #15

New Contributors

Full Changelog: v3.0.4...v3.1.0