Skip to content
Myr

fix(types): broken test in future versions of typescript (#3310)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by m-shaka · committed by GitHub · parent d1c7f6f · Browse files · 1 file+5 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−2 removed

  • tests:+5 added−2 removed

1 file+5 added−2 removed

modified:src/types.test.ts+5 added-2 removed
2247 unmodified lines
2248 type verify = Expect<Equal<Expected, Actual>>2249 })2250})2251describe('generic typed variables', () => {2252 const okHelper = (c: Context) => {2253 return <TData>(data: TData) => c.json({ data })2254 }2255 type Variables = {2253 ok: <TData>(data: TData) => TypedResponse<{ data: TData }>2256 ok: ReturnType<typeof okHelper>2257 }2258 const app = new Hono<{ Variables: Variables }>()22592260 it('Should set and get variables with correct types', async () => {2261 const route = app2262 .use('*', async (c, next) => {2260 c.set('ok', (data) => c.json({ data }))2263 c.set('ok', okHelper(c))2264 await next()2265 })2266 .get('/', (c) => {2267 const ok = c.get('ok')
7 unmodified lines