Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mocking session storage #451

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

stfnio
Copy link
Contributor

@stfnio stfnio commented Feb 17, 2022

This PR is intended to add support for mocking window.sessionStorage.
Since both sessionStorage and localStorage implement the same Storage API this should be straightforward to support.

Please, let me know what are your thoughts on this and how this PR can be improved.

@stfnio
Copy link
Contributor Author

stfnio commented Feb 17, 2022

@simonihmig Could you please take a look at this? Recently we faced the need to mock sessionStorage in our project, hence this PR.

Copy link
Owner

@simonihmig simonihmig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This totally makes sense, thanks for working on this!

Back then when localStorage support was added, I thought that we could actually add sessionStorage support the same way. But then forgot about it, and apparently nobody cared, until now. So good to have this finally!

@simonihmig simonihmig merged commit 2b17594 into simonihmig:master Feb 17, 2022
@stfnio
Copy link
Contributor Author

stfnio commented Feb 17, 2022

@simonihmig Thanks a lot for your quick response! Appreciate that 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants