Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f4754e

Browse files
committed
fix(e2e): ensure $fetch is not typed as any
1 parent aef6933 commit 1f4754e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/e2e/server.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { x } from 'tinyexec'
22
import { getRandomPort, waitForPort } from 'get-port-please'
3-
import type { FetchOptions } from 'ofetch'
3+
import type { $Fetch, FetchOptions } from 'ofetch'
44
import { fetch as _fetch, createFetch } from 'ofetch'
55
import { resolve } from 'pathe'
66
import { joinURL } from 'ufo'
@@ -93,7 +93,7 @@ const _$fetch = createFetch({ fetch: globalFetch })
9393

9494
export const $fetch = function $fetch(path: string, options?: FetchOptions) {
9595
return _$fetch(url(path), options)
96-
} as (typeof globalThis)['$fetch']
96+
} as '$fetch' extends keyof typeof globalThis ? typeof globalThis.$fetch : $Fetch
9797

9898
export function url(path: string) {
9999
const ctx = useTestContext()

0 commit comments

Comments
 (0)