]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
test: fix types
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 16 Jan 2020 17:22:08 +0000 (18:22 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 20 Jan 2020 18:21:18 +0000 (19:21 +0100)
__tests__/ssr/app/main.ts
jest.config.js
src/devtools.ts

index 548cfb1786ca6e831006730c6c1688e9f9d735bb..ea8fa3621610aae918dc4dfac5d28641e440f4cf 100644 (file)
@@ -2,14 +2,15 @@ import Vue from 'vue'
 // import VueCompositionApi from '@vue/composition-api'
 import App from './App'
 import { useStore } from './store'
+import { setActiveReq } from '../../../src'
 
 // Done in setup.ts
 // Vue.use(VueCompositionApi)
 
 export function createApp() {
   // create router and store instances
-  const store = useStore(true)
-  store.reset()
+  setActiveReq({})
+  const store = useStore()
 
   store.state.counter++
 
index eb5cc4804bb34a231e5b14d6b6ba8b108ae80df6..9672b3532d01cb60d255c85f389544d2b816dd38 100644 (file)
@@ -1,7 +1,7 @@
 module.exports = {
   preset: 'ts-jest',
   collectCoverage: true,
-  collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
+  collectCoverageFrom: ['<rootDir>/src/**/*.ts', '!<rootDir>/src/devtools.ts'],
   testMatch: ['<rootDir>/__tests__/**/*.spec.ts'],
   setupFilesAfterEnv: ['./__tests__/setup.ts'],
   globals: {
index 9f9e6a2226d200312b54be4e7a17c44186082b90..154467d9ec1d73e2339597842d1e6f0e5f4dc82b 100644 (file)
@@ -1,4 +1,4 @@
-import { DevtoolHook, StateTree, Store } from './types'
+import { DevtoolHook, StateTree, StoreWithState } from './types'
 
 const target =
   typeof window !== 'undefined'
@@ -29,7 +29,7 @@ interface RootState {
 
 let rootStore: RootState
 
-export function useStoreDevtools(store: Store<string, StateTree>) {
+export function useStoreDevtools(store: StoreWithState<string, StateTree>) {
   if (!devtoolHook) return
 
   if (!rootStore) {