-
Couldn't load subscription status.
- Fork 664
Open
Description
Subject of the issue
When defining global provides using a Symbol / vues InjectionKey<T> type there is a type error.
Steps to reproduce
const testKey: InjectionKey<string> = Symbol("testKey");
config.global.provide[testKey] = "testValue";
// Type 'InjectionKey<string>' cannot be used as an index type.ts(2538)Expected behaviour
Symbols should be supported in the type, as they work at runtime.
Actual behaviour
TS Error
Possible Solution
| provide?: Record<string, any>, |
I think changing the type here would suffice
// Currently
export interface VueTestUtilsConfigOptions {
stubs: Record<string, Component | boolean | string>
mocks: Record<string, any>
methods: Record<string, Function>
provide?: Record<string, any>,
showDeprecationWarnings?: boolean
deprecationWarningHandler?: Function
}
// Fixed
export interface VueTestUtilsConfigOptions {
stubs: Record<string, Component | boolean | string>
mocks: Record<string, any>
methods: Record<string, Function>
provide?: Record<string | symbol, any>,
showDeprecationWarnings?: boolean
deprecationWarningHandler?: Function
}Metadata
Metadata
Assignees
Labels
No labels