Skip to content

fix: notify listeners on clearAll in mock - #1093

Open
Pajimo wants to merge 1 commit into
margelo:mainfrom
Pajimo:fix/mock-clearall-listeners
Open

Pajimo wants to merge 1 commit into
margelo:mainfrom
Pajimo:fix/mock-clearall-listeners

Conversation

@Pajimo

@Pajimo Pajimo commented Sep 23, 2026

Copy link
Copy Markdown

The jest mock grabbed storage.keys() before storage.clear(), but that iterator is live so the loop saw nothing and listeners never fired. Hooks kept the old value after clearAll() in tests. Copying keys to an array first.

Test plan: added a hooks test that sets a value, calls clearAll() and expects undefined. Fails on main, passes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant