···55 * Gives access to injected context provided from the main thread.
66 * This usually returns a value provided by `globalSetup` or an external library.
77 */
88-export function inject<T extends keyof ProvidedContext>(
88+export function inject<T extends keyof ProvidedContext & string>(
99 key: T,
1010): ProvidedContext[T] {
1111 const workerState = getWorkerState()
1212- return workerState.providedContext[key]
1212+ return workerState.providedContext[key] as ProvidedContext[T]
1313}