diff --git a/packages/test/test-end-to-end-tests/src/testSnapshotCache.ts b/packages/test/test-end-to-end-tests/src/testSnapshotCache.ts index f6ce23c8974b..226ed385e4d7 100644 --- a/packages/test/test-end-to-end-tests/src/testSnapshotCache.ts +++ b/packages/test/test-end-to-end-tests/src/testSnapshotCache.ts @@ -16,16 +16,19 @@ export interface ValueWithSnapshot { } export class TestSnapshotCache implements IPersistedCache { - private readonly cache = new Map(); + private readonly cache = new Map(); private readonly versionCache = new Map(); private readonly versionToCacheKey = new Map(); - public async get(entry: ICacheEntry): Promise { + public async get(entry: ICacheEntry): Promise { const key = getKeyForCacheEntry(entry); return this.cache.get(key); } - public async put(entry: ICacheEntry, value: ValueWithSnapshot): Promise { + public async put(entry: ICacheEntry, value: any): Promise { const key = getKeyForCacheEntry(entry); this.cache.set(key, value); + if (value.value?.snapshotTree?.id === undefined) { + return; + } const versionKey = `${value.value.snapshotTree.id}`; this.versionCache.set(versionKey, value); this.versionToCacheKey.set(versionKey, key);