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

[Bug] jest mock returns null when falsy values are stored #360

Open
shrouxm opened this issue Oct 8, 2024 · 0 comments
Open

[Bug] jest mock returns null when falsy values are stored #360

shrouxm opened this issue Oct 8, 2024 · 0 comments

Comments

@shrouxm
Copy link

shrouxm commented Oct 8, 2024

Describe the bug
When using the jest mock, if you store falsy values and then retrieve them from the store you will get null back.

For example, in a test file:

mmkv.setBool('key', false);
mmkv.getBool('key'); // returns null

mmkv.setString('key', '');
mmkv.getString(''); // returns null

Expected behavior
Should return the falsy value instead of null

Additional context
I think this PR intended to fix the issue, but it updates the .ts file without updating the .js file in the dist folder so users are still running code with the bug.

I'm not sure how to generate a new dist folder so hoping that will be an easy step for maintainers!

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

No branches or pull requests

1 participant