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

fix: Use .mock extension for MMKV mocks #647

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Mar 11, 2024

  1. refactor: use .mock as intended; remove platformChecker

    .mock files are supposed to replace their regular counterparts when running in mock mode. It doesn't make much sense to import from both and have a check to determine which to use. Instead, metro  should pick the one that is currently relevant. This is achieved by giving the functions the same name and only importing from the regular one. the .mock one is used when running in mock mode.
    Chris Kapinga committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    9812061 View commit details
    Browse the repository at this point in the history
  2. fix: add mock for createMMKV in unit test

    jest doesn't pick the .mock file by default. adding jest.mock in the test file solves this.
    
    If there are more testFiles, the mock can be made globally in a jest.setup
    Chris Kapinga committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    640ec5b View commit details
    Browse the repository at this point in the history