The context examples only cover the basic getContext() and setContext() API. There's no example for the type-safe createContext() API:
import { createContext } from 'svelte';
export const [getUserContext, setUserContext] = createContext<User>();
These context functions don't use a key, so the context: Map([[<key>, <value>], ...]) approach doesn't seem to be appropriate. I'm just getting to grips with Svelte testing, so I'm not sure how to do this myself yet. If I figure it out then I may open a PR.