]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
chore: up test utils
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 Jul 2023 12:14:56 +0000 (14:14 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 3 Jul 2023 12:14:56 +0000 (14:14 +0200)
packages/pinia/__tests__/pinia/stores/combined.ts
packages/pinia/__tests__/store.spec.ts
packages/pinia/package.json

index db728c73a7d88a3c2ebb2080aec5dd77eebdf19c..badd798f6ad6549d2107c020ef290d8d41d8e99c 100644 (file)
@@ -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()
+}
index 20a84b6e9cc4bd7bd980460355d9da93ce2cb025..b5616f9048995745e8836ac9c370afe47bbf34f0 100644 (file)
@@ -60,13 +60,13 @@ describe('Store', () => {
       id: 'main',
       state: () => ({ n: 0 }),
     })
-    const TestComponent = {
+    const TestComponent = defineComponent({
       template: `<div>{{ store. n }}</div>`,
       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')
index 3f2d1ce3f406cace2627b932cd90b262298d5843..c7d19940e143deb834920f9f407ce8ff3fbd6486 100644 (file)
@@ -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",