Skip to content

Commit

Permalink
refactor: reduce node-specific usage
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Oct 24, 2023
1 parent 4d339ee commit e07d1b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable test/prefer-lowercase-title */
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { createApp, eventHandler, readBody, toNodeListener } from 'h3'
import { createApp, eventHandler, getRequestHeaders, readBody, toNodeListener } from 'h3'
import { listen } from 'listhen'
import { getQuery } from 'ufo'
import type { Listener } from 'listhen'
Expand All @@ -21,12 +21,12 @@ describe('unrested', () => {
.use('/foo/1', eventHandler(() => ({ foo: '1' })))
.use('/foo', eventHandler(() => ({ foo: 'bar' })))
.use('/bar', eventHandler(async event => ({
url: event.node.req.url,
url: event.path,
body: await readBody(event),
headers: event.node.req.headers,
method: event.node.req.method,
headers: getRequestHeaders(event),
method: event.method,
})))
.use('/params', eventHandler(event => getQuery(event.node.req.url || '')))
.use('/params', eventHandler(event => getQuery(event.path || '')))

listener = await listen(toNodeListener(app))
client = createClient({
Expand Down

0 comments on commit e07d1b5

Please sign in to comment.