@@ -3,7 +3,6 @@ import { getRandomPort, waitForPort } from 'get-port-please'
33import type { FetchOptions } from 'ofetch'
44import { $fetch as _$fetch , fetch as _fetch } from 'ofetch'
55import * as _kit from '@nuxt/kit'
6- import type { $Fetch } from 'nitropack'
76import { resolve } from 'pathe'
87import { useTestContext } from './context'
98
@@ -39,7 +38,7 @@ export async function startServer(options: StartServerOptions = {}) {
3938 for ( let i = 0 ; i < 150 ; i ++ ) {
4039 await new Promise ( resolve => setTimeout ( resolve , 100 ) )
4140 try {
42- const res = await $fetch < string > ( ctx . nuxt ! . options . app . baseURL , { responseType : 'text' } )
41+ const res = await $fetch ( ctx . nuxt ! . options . app . baseURL , { responseType : 'text' } ) as string
4342 if ( ! res . includes ( '__NUXT_LOADING__' ) ) {
4443 return
4544 }
@@ -79,9 +78,10 @@ export function fetch(path: string, options?: RequestInit) {
7978 return _fetch ( url ( path ) , options )
8079}
8180
82- export const $fetch = ( function $fetch ( path : string , options ?: FetchOptions ) {
81+ // TODO: fix type inference of `$fetch`
82+ export function $fetch ( path : string , options ?: FetchOptions ) {
8383 return _$fetch ( url ( path ) , options )
84- } ) as $Fetch
84+ }
8585
8686export function url ( path : string ) {
8787 const ctx = useTestContext ( )
0 commit comments