From: Eduardo San Martin Morote Date: Mon, 3 Jul 2023 12:14:56 +0000 (+0200) Subject: chore: up test utils X-Git-Tag: @pinia/testing@0.1.3~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b171df8ae4fcdbec9734e208745f9c0b9bbc49c;p=thirdparty%2Fvuejs%2Fpinia.git chore: up test utils --- 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",