From: Evan You Date: Tue, 18 Feb 2020 04:26:25 +0000 (-0500) Subject: chore: fix dts tests X-Git-Tag: v3.0.0-alpha.5~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb03362b084bf877ab7df872326c286e609319b1;p=thirdparty%2Fvuejs%2Fcore.git chore: fix dts tests --- diff --git a/test-dts/watch.test-d.ts b/test-dts/watch.test-d.ts index 72a38e8d02..7f49691cb8 100644 --- a/test-dts/watch.test-d.ts +++ b/test-dts/watch.test-d.ts @@ -5,25 +5,6 @@ const source = ref('foo') const source2 = computed(() => source.value) const source3 = () => 1 -// eager watcher's oldValue will be undefined on first run. -watch(source, (value, oldValue) => { - expectType(value) - expectType(oldValue) -}) - -watch([source, source2, source3], (values, oldValues) => { - expectType<(string | number)[]>(values) - expectType<(string | number | undefined)[]>(oldValues) -}) - -// const array -watch([source, source2, source3] as const, (values, oldValues) => { - expectType>(values) - expectType< - Readonly<[string | undefined, string | undefined, number | undefined]> - >(oldValues) -}) - // lazy watcher will have consistent types for oldValue. watch(source, (value, oldValue) => { expectType(value) @@ -41,7 +22,7 @@ watch([source, source2, source3] as const, (values, oldValues) => { expectType>(oldValues) }) -// source + immediate: true +// immediate watcher's oldValue will be undefined on first run. watch( source, (value, oldValue) => {