From 2b171df8ae4fcdbec9734e208745f9c0b9bbc49c Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 3 Jul 2023 14:14:56 +0200 Subject: [PATCH] chore: up test utils --- .../pinia/__tests__/pinia/stores/combined.ts | 16 +++++++++------- packages/pinia/__tests__/store.spec.ts | 4 ++-- packages/pinia/package.json | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/pinia/__tests__/pinia/stores/combined.ts b/packages/pinia/__tests__/pinia/stores/combined.ts index db728c73..badd798f 100644 --- a/packages/pinia/__tests__/pinia/stores/combined.ts +++ b/packages/pinia/__tests__/pinia/stores/combined.ts @@ -5,12 +5,14 @@ import { pinia, CombinedState } from '../../../src/pinia' // in this file we could import other stores that use one each other while // avoiding any recursive import -type S = CombinedState<{ - user: typeof useUserStore - cart: typeof useCartStore -}> +export function _test() { + type S = CombinedState<{ + user: typeof useUserStore + cart: typeof useCartStore + }> -let a: S + let a: S -a.user.isAdmin = false -a.cart.rawItems.push() + a.user.isAdmin = false + a.cart.rawItems.push() +} diff --git a/packages/pinia/__tests__/store.spec.ts b/packages/pinia/__tests__/store.spec.ts index 20a84b6e..b5616f90 100644 --- a/packages/pinia/__tests__/store.spec.ts +++ b/packages/pinia/__tests__/store.spec.ts @@ -60,13 +60,13 @@ describe('Store', () => { id: 'main', state: () => ({ n: 0 }), }) - const TestComponent = { + const TestComponent = defineComponent({ template: `
{{ store. n }}
`, setup() { const store = useStore() return { store } }, - } + }) const w1 = mount(TestComponent, { global: { plugins: [pinia] } }) const w2 = mount(TestComponent, { global: { plugins: [pinia] } }) expect(w1.text()).toBe('0') diff --git a/packages/pinia/package.json b/packages/pinia/package.json index 3f2d1ce3..c7d19940 100644 --- a/packages/pinia/package.json +++ b/packages/pinia/package.json @@ -70,7 +70,7 @@ "license": "MIT", "devDependencies": { "@microsoft/api-extractor": "7.34.4", - "@vue/test-utils": "^2.3.2" + "@vue/test-utils": "^2.4.0" }, "dependencies": { "@vue/devtools-api": "^6.5.0", -- 2.47.3