]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
chore: playground tests
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 31 Jul 2023 07:03:54 +0000 (09:03 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 31 Jul 2023 07:03:54 +0000 (09:03 +0200)
packages/nuxt/playground/app.vue
packages/nuxt/playground/composables/counter.ts [deleted file]
packages/nuxt/playground/nuxt.config.ts

index b36025b412b1d7b03a6fe97e1751233b0fa271dc..02df7895adfc138fd5320be39194a97ddfc70526 100644 (file)
@@ -1,6 +1,10 @@
 <script lang="ts" setup>
+// import {useCounter }from '~/stores/counter'
+
 const counter = useCounter()
 
+useTestStore()
+
 if (process.server) {
   counter.increment()
 }
diff --git a/packages/nuxt/playground/composables/counter.ts b/packages/nuxt/playground/composables/counter.ts
deleted file mode 100644 (file)
index 6d164f0..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-export const useCounter = definePiniaStore('counter', {
-  state: () => ({
-    count: 100,
-  }),
-  actions: {
-    increment() {
-      this.count++
-    },
-  },
-  getters: {
-    getCount: (state) => state.count,
-  },
-})
index ab61bcbccd645ad86d449b1ee798bba144240587..2659d2a80a62b58a23f84881869ccbc3b1e6fff4 100644 (file)
@@ -7,7 +7,15 @@ export default defineNuxtConfig({
     pinia: fileURLToPath(new URL('../../pinia/src/index.ts', import.meta.url)),
   },
   modules: [piniaModule],
+
   pinia: {
-    autoImports: [['defineStore', 'definePiniaStore']],
+    storesDirs: ['./stores', './domain/*/stores'],
+  },
+
+  vite: {
+    define: {
+      __DEV__: JSON.stringify(process.env.NODE_ENV !== 'production'),
+      __TEST__: 'false',
+    },
   },
 })