afterEach(() => { delete (process as unknown as Record<symbol, unknown>)[MAP_KEY]; delete (process as unknown as Record<symbol, unknown>)[OTHER_MAP_KEY];
});
describe("shared/process-scoped-map", () => {
it("reuses the same map for the same symbol", () => { const first = resolveProcessScopedMap<number>(MAP_KEY);
first.set("a", 1);
const second = resolveProcessScopedMap<number>(MAP_KEY);
it("keeps distinct maps for distinct symbols", () => { const first = resolveProcessScopedMap<number>(MAP_KEY); const second = resolveProcessScopedMap<number>(OTHER_MAP_KEY);
expect(second).not.toBe(first);
});
it("reuses a prepopulated process map without replacing it", () => { const existing = new Map<string, number>([["a", 1]]);
(process as unknown as Record<symbol, unknown>)[MAP_KEY] = existing;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.