Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Nov 23, 2021
1 parent 62f5a5c commit 33dd46a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/type/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ const expectType: ExpectType = () => {}

const truthy: () => boolean = () => true

export function useDataErrorGeneric() {
useSWR<{ id: number }>('/api/', () => ({ id: 123 }))
useSWR<string, any>('/api/', (key: string) => key)
}

export function useString() {
useSWR('/api/user', key => {
expectType<string>(key)
Expand Down

0 comments on commit 33dd46a

Please sign in to comment.