Skip to content

Commit 4d19fac

Browse files
committed
test(useContext): clean up imports
1 parent 7921d6e commit 4d19fac

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/0/src/factories/createContext/index.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// Factories
2+
import { createContext } from './index'
3+
4+
// Utilities
15
import { describe, it, expect, vi, beforeEach } from 'vitest'
26
import { provide, inject } from 'vue'
3-
import { createContext } from './index'
47

58
vi.mock('vue', () => ({
69
provide: vi.fn(),

packages/0/src/factories/createContext/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function useContext<Z> (key: ContextKey<Z>) {
3636
*/
3737
export function createContext<Z> (key: ContextKey<Z>) {
3838
function provideContext (context: Z, app?: App) {
39-
app ? app.provide(key, context) : provide(key, context)
39+
app?.provide(key, context) ?? provide(key, context)
4040

4141
return context
4242
}

0 commit comments

Comments
 (0)