Skip to content

Commit 62070b8

Browse files
committed
chore: conditionally enable req body tests
1 parent 55141ed commit 62070b8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/runtime/src/helpers/edge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const fetch = async (url, init) => {
111111
return new Response(_base64Decode(_ASSETS[key]))
112112
}
113113
}
114-
return _fetch(url, init)
114+
return await _fetch(url, init)
115115
} catch (error) {
116116
console.error(error)
117117
throw error

test/e2e/modified-tests/edge-can-read-request-body/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Edge can read request body', () => {
2828
expect(html).toContain('ok')
2929
})
3030
// NTL Fail
31-
describe.skip('middleware', () => {
31+
;(process.env.RUN_SKIPPED_TESTS ? describe : describe.skip)('middleware', () => {
3232
it('reads a JSON body', async () => {
3333
const response = await fetchViaHTTP(next.url, '/api/nothing?middleware-handler=json', null, {
3434
method: 'POST',

test/e2e/next-test-lib/next-test-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ export function renderViaHTTP(appPort, pathname, query, opts) {
122122
* @param {string | number} appPort
123123
* @param {string} pathname
124124
* @param {Record<string, any> | string | undefined} query
125-
* @param {import("undici").RequestInit} opts
126-
* @returns {Promise<import("undici").Response>}
125+
* @param {RequestInit} opts
126+
* @returns {Promise<Response>}
127127
*/
128128
export async function fetchViaHTTP(appPort, pathname, query = undefined, opts = undefined, useUndici = false) {
129129
const url = `${pathname}${typeof query === 'string' ? query : query ? `?${qs.stringify(query)}` : ''}`

0 commit comments

Comments
 (0)