Skip to content

Commit

Permalink
types(ref): fix dts test for ref (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
pikax authored Apr 15, 2020
1 parent e33291b commit acfcc55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test-dts/ref.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectType } from 'tsd'
import { Ref, ref, isRef, unref, UnwrapRef } from './index'
import { Ref, ref, isRef, unref } from './index'

function plainType(arg: number | Ref<number>) {
// ref coercing
Expand Down Expand Up @@ -29,7 +29,9 @@ function plainType(arg: number | Ref<number>) {
}

// with symbol
expectType<IteratorFoo | null>(unref(ref<IteratorFoo | null>(null)))
expectType<Ref<IteratorFoo | null | undefined>>(
ref<IteratorFoo | null | undefined>()
)
}

plainType(1)
Expand Down

0 comments on commit acfcc55

Please sign in to comment.