From 8989701303326880aacd999bfe6e0b92dd2df293 Mon Sep 17 00:00:00 2001 From: robonen Date: Sun, 20 Oct 2024 06:44:19 +0700 Subject: [PATCH] feat(packages/vue): add useContextFactory composable --- .../vue/src/composables/useContextFactory/index.test.ts | 8 ++++---- packages/vue/src/composables/useContextFactory/index.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/vue/src/composables/useContextFactory/index.test.ts b/packages/vue/src/composables/useContextFactory/index.test.ts index 9b797de..b71a494 100644 --- a/packages/vue/src/composables/useContextFactory/index.test.ts +++ b/packages/vue/src/composables/useContextFactory/index.test.ts @@ -37,7 +37,7 @@ function testFactory( // TODO: maybe replace template with passing mock functions to setup describe('useContextFactory', () => { - it('should provide and inject context correctly', () => { + it('provide and inject context correctly', () => { const { Parent } = testFactory('test'); const component = mount(Parent); @@ -45,13 +45,13 @@ describe('useContextFactory', () => { expect(component.text()).toBe('test'); }); - it('should throw an error when context is not provided', () => { + it('throw an error when context is not provided', () => { const { Child } = testFactory('test'); expect(() => mount(Child)).toThrow(VueToolsError); }); - it('should inject a fallback value when context is not provided', () => { + it('inject a fallback value when context is not provided', () => { const { Child } = testFactory('test', { fallback: 'fallback' }); const component = mount(Child); @@ -59,7 +59,7 @@ describe('useContextFactory', () => { expect(component.text()).toBe('fallback'); }); - it('should correctly handle null values', () => { + it('correctly handle null values', () => { const { Parent } = testFactory(null); const component = mount(Parent); diff --git a/packages/vue/src/composables/useContextFactory/index.ts b/packages/vue/src/composables/useContextFactory/index.ts index 773162e..801e233 100644 --- a/packages/vue/src/composables/useContextFactory/index.ts +++ b/packages/vue/src/composables/useContextFactory/index.ts @@ -1,5 +1,5 @@ import { inject, provide, type InjectionKey } from 'vue'; -import { VueToolsError } from '../../utils'; +import { VueToolsError } from '../..'; /** * @name useContextFactory