Skip to content

Commit c1be573

Browse files
elirangoshenclaude
andcommitted
test: use for…of in evictFromCache helper to satisfy unicorn/no-array-for-each
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 33a4722 commit c1be573

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tests/unit/onyxUtilsTest.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,12 @@ describe('OnyxUtils', () => {
954954
// miss it (unless the entire storageKeys set is empty, in which case the function falls back
955955
// to Storage.getAllKeys). To reliably hit the cold-but-persisted state regardless of how many
956956
// other keys remain in cache, we re-register the key as known after dropping its value.
957-
const evictFromCache = (...keys: string[]) =>
958-
keys.forEach((key) => {
957+
const evictFromCache = (...keys: string[]) => {
958+
for (const key of keys) {
959959
OnyxCache.drop(key);
960960
OnyxCache.addKey(key);
961-
});
961+
}
962+
};
962963

963964
it('fast path: skips storage reads entirely when every existing key is warm in cache', async () => {
964965
const collectionKey = ONYXKEYS.COLLECTION.TEST_KEY;

0 commit comments

Comments
 (0)