Testing your Mobile App
    • Dark
      Light
    • PDF

    Testing your Mobile App

    • Dark
      Light
    • PDF

    Article summary

    Testing is an integral part of mobile app development to ensure the reliability, functionality, and user experience of your Rocket.Chat Mobile app. The Rocket.Chat Mobile App has unit tests and e2e tests.

    This guide will walk you through various testing approaches for Rocket.Chat mobile App.

    How to inspect the app

    Reactotron is used to inspect logs, redux state, redux-sagas, HTTP requests, etc.

    Unit tests

    Unit tests focus on isolating and testing individual components or functions within your app. They help identify and fix bugs early in the development process and ensure that each part of your app works as intended. For unit tests, we use Jest and Storybook.

    Storybook

    Storybook is a tool for developing UI Components with some plugins to make Jest generate snapshots. Navigate to the index.js file on your project's root directory, and keep only the last Storybook import while commenting the remaining part of the code. Then, refresh your project, and you will observe the generation of tests like this:

    Jest

    We use Jest for unit tests and to generate Storybook snapshots. There is a pre-commit hook to prevent commits that breaks any test. To check for test issues on your code, run this command:

    yarn test

    E2E tests

    Detox framework tests our app end-to-end and ensures everything works properly.

    To run the test, follow the steps on the e2e GitHub repository.

    Code style

    ESLint is used to enforce code style and best practices. There is a pre-commit hook enforcing commits to follow our lint rules.

    To check for lint issues on your code, run this command:

    yarn lint

    Code formatting

    Prettier is used to format the code style in our project. There is a pre-commit hook enforcing the commits to follow our style guides.

    To fix your code formatting issues, run this on your terminal:

    yarn prettier-lint

    To integrate Prettier with your preferred code editor, see the official documentation.


    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.
    ESC

    Eddy AI, facilitating knowledge discovery through conversational intelligence