alvarosabu 2 лет назад
Родитель
Сommit
0a39573a2f
2 измененных файлов с 8 добавлено и 2 удалено
  1. 2 1
      src/composables/useTres/index.ts
  2. 6 1
      src/composables/useTres/useTres.test.ts

+ 2 - 1
src/composables/useTres/index.ts

@@ -99,7 +99,7 @@ export type UseTresReturn = {
 }
 }
 
 
 const TRES_CONTEXT_KEY = Symbol()
 const TRES_CONTEXT_KEY = Symbol()
-const { logError } = useLogger()
+
 /**
 /**
  * The Tres state.
  * The Tres state.
  *
  *
@@ -152,6 +152,7 @@ export function useTresProvider() {
 
 
 export const useTres = () => {
 export const useTres = () => {
   const context = inject(TRES_CONTEXT_KEY)
   const context = inject(TRES_CONTEXT_KEY)
+  const { logError } = useLogger()
 
 
   if (!context) logError('UseTres together with useTresProvider')
   if (!context) logError('UseTres together with useTresProvider')
 
 

+ 6 - 1
src/composables/useTres/useTres.test.ts

@@ -1,6 +1,11 @@
+import { useTresProvider } from '/@/composables'
 import { useTres } from '.'
 import { useTres } from '.'
+import { withSetup } from '/@/utils/test-utils'
 
 
-describe('useTres', () => {
+describe.skip('useTres', () => {
+  beforeAll(() => {
+    useTresProvider()
+  })
   it('should set the state', () => {
   it('should set the state', () => {
     const { state, setState } = useTres()
     const { state, setState } = useTres()
     setState('foo', 'bar')
     setState('foo', 'bar')