File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export async function startServer(options: StartServerOptions = {}) {
3838 for ( let i = 0 ; i < 150 ; i ++ ) {
3939 await new Promise ( resolve => setTimeout ( resolve , 100 ) )
4040 try {
41- const res = await $fetch ( ctx . nuxt ! . options . app . baseURL , { responseType : 'text' } ) as string
41+ const res = await $fetch < string > ( ctx . nuxt ! . options . app . baseURL , { responseType : 'text' } )
4242 if ( ! res . includes ( '__NUXT_LOADING__' ) ) {
4343 return
4444 }
@@ -78,10 +78,9 @@ export function fetch(path: string, options?: RequestInit) {
7878 return _fetch ( url ( path ) , options )
7979}
8080
81- // TODO: fix type inference of `$fetch`
82- export function $fetch ( path : string , options ?: FetchOptions ) {
81+ export const $fetch = ( function ( path : string , options ?: FetchOptions ) {
8382 return _$fetch ( url ( path ) , options )
84- }
83+ } ) as typeof globalThis [ '$fetch' ]
8584
8685export function url ( path : string ) {
8786 const ctx = useTestContext ( )
You can’t perform that action at this time.
0 commit comments