From: Eduardo San Martin Morote Date: Fri, 9 Apr 2021 18:36:22 +0000 (+0200) Subject: test: add more context tests X-Git-Tag: v2.0.0-alpha.13~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2601734c9ae3f27eff2402bfc246fcf3f133395a;p=thirdparty%2Fvuejs%2Fpinia.git test: add more context tests --- diff --git a/test-dts/store.test-d.ts b/test-dts/store.test-d.ts index 5350092b..e1a02adf 100644 --- a/test-dts/store.test-d.ts +++ b/test-dts/store.test-d.ts @@ -5,8 +5,22 @@ const useStore = defineStore({ state: () => ({ a: 'on' as 'on' | 'off', nested: { counter: 0 } }), getters: { upper() { + expectType<'on' | 'off'>(this.a) return this.a.toUpperCase() }, + other() { + expectType(this.upper) + return false + }, + }, + actions: { + doStuff() { + expectType(this.upper) + expectType(this.other) + }, + otherOne() { + expectType<() => void>(this.doStuff) + }, }, })