]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
chore: remove unused code
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 25 Jun 2021 10:28:45 +0000 (12:28 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 25 Jun 2021 10:28:45 +0000 (12:28 +0200)
src/index.ts
src/testing.ts

index e9d31f238fd6e35fcf0e36f59970aa79c1cc9815..09813b1b93172690cf7cef3c5a5c466a7935188e 100644 (file)
@@ -50,5 +50,5 @@ export type {
   _StoreObject,
 } from './mapHelpers'
 
-export { createTestingPinia, getMockedStore } from './testing'
+export { createTestingPinia } from './testing'
 export type { TestingOptions } from './testing'
index 68867b5f75467d01b42da17e87390cef97f6ce58..df7677d91aad653d5fe56ffb336e4e4b8cd0d1c3 100644 (file)
@@ -69,31 +69,3 @@ export function createTestingPinia({
 
   return pinia
 }
-
-type StoreWithMockedActions<Spy, S extends Store> = S extends Store<
-  string,
-  StateTree,
-  GettersTree<StateTree>,
-  infer A
->
-  ? {
-      [K in keyof A]: Spy
-    }
-  : {}
-
-/**
- * Returns a type safe store that has mocks instead of actions. Requires a Mock type as a generic
- *
- * @example
- * ```ts
- * const pinia = createTestingPinia({ createSpy: jest.fn })
- * ```
- *
- * @param store - store created with a testing pinia
- * @returns a type safe store
- */
-export function getMockedStore<Spy, S extends Store>(
-  store: S
-): S & StoreWithMockedActions<Spy, S> {
-  return store as S & StoreWithMockedActions<Spy, S>
-}