Skip to content

Commit cb03362

Browse files
committed
chore: fix dts tests
1 parent 2fb7a63 commit cb03362

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

test-dts/watch.test-d.ts

+1-20
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@ const source = ref('foo')
55
const source2 = computed(() => source.value)
66
const source3 = () => 1
77

8-
// eager watcher's oldValue will be undefined on first run.
9-
watch(source, (value, oldValue) => {
10-
expectType<string>(value)
11-
expectType<string | undefined>(oldValue)
12-
})
13-
14-
watch([source, source2, source3], (values, oldValues) => {
15-
expectType<(string | number)[]>(values)
16-
expectType<(string | number | undefined)[]>(oldValues)
17-
})
18-
19-
// const array
20-
watch([source, source2, source3] as const, (values, oldValues) => {
21-
expectType<Readonly<[string, string, number]>>(values)
22-
expectType<
23-
Readonly<[string | undefined, string | undefined, number | undefined]>
24-
>(oldValues)
25-
})
26-
278
// lazy watcher will have consistent types for oldValue.
289
watch(source, (value, oldValue) => {
2910
expectType<string>(value)
@@ -41,7 +22,7 @@ watch([source, source2, source3] as const, (values, oldValues) => {
4122
expectType<Readonly<[string, string, number]>>(oldValues)
4223
})
4324

44-
// source + immediate: true
25+
// immediate watcher's oldValue will be undefined on first run.
4526
watch(
4627
source,
4728
(value, oldValue) => {

0 commit comments

Comments
 (0)