Skip to content

Commit 02276e2

Browse files
authored
Merge pull request #195 from cexbrayat/fix/189-partial-config
fix(mount): mount should accept a partial config
2 parents 309af60 + 88c0a1d commit 02276e2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type FindAllComponentsSelector = NameSelector | string
2121

2222
export type GlobalMountOptions = {
2323
plugins?: (Plugin | [Plugin, ...any[]])[]
24-
config?: Omit<AppConfig, 'isNativeTag'> // isNativeTag is readonly, so we omit it
24+
config?: Partial<Omit<AppConfig, 'isNativeTag'>> // isNativeTag is readonly, so we omit it
2525
mixins?: ComponentOptions[]
2626
mocks?: Record<string, any>
2727
provide?: Record<any, any>

test-dts/mount.d-test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,13 @@ expectType<number>(
143143
}
144144
}).vm.a
145145
)
146+
147+
// global config should accept a partial config
148+
mount(AppWithProps, {
149+
props: { a: 'Hello' },
150+
global: {
151+
config: {
152+
isCustomElement: (tag: string) => true
153+
}
154+
}
155+
})

0 commit comments

Comments
 (0)