import { test } from '@japa/runner'
import { UrlEncodedReader } from '../../../src/index.js'

test.group('UrlEncodedReader', () => {
  test('returns a value for a simple path', async ({ assert }) => {
    const payload = 'a=b&c=d'
    const reader = new UrlEncodedReader()
    await reader.writePayload(payload)
    const result = await reader.getValue('a')
    assert.equal(result, 'b')
  })
})
