Unit Testing Expo Apps With Jest

This page summarizes the projects mentioned and recommended in the original post on dev.to

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. async-storage

    An asynchronous, persistent, key-value storage system for React Native.

    \[@RNC/AsyncStorage\]: NativeModule: AsyncStorage is null. To fix this issue try these steps: • Rebuild and restart the app. • Run the packager with \`--reset-cache\` flag. • If you are using CocoaPods on iOS, run \`pod install\` in the \`ios\` directory and then rebuild and re-run the app. • If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-async-storage/async-storage/issues 5 | import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; 6 | import { Platform } from 'react-native'; > 7 | import AsyncStorage from '@react-native-async-storage/async-storage';

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. nx

    Build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.

    In my latest blog, I successfully navigated through the steps of setting up an Expo Monorepo with Nx. The next challenge? Testing! This blog dives into:

  4. redux-mock-store

    A mock store for testing Redux async action creators and middleware.

    To fix this, the simple way is to mock a redux store. I need to install redux-mock-store and its typing:

  5. uuid

    Generate RFC-compliant UUIDs in JavaScript

    I got this error when using a library with ECMAScript Module (ESM), such as [udid](https://github.com/uuidjs/uuid):

  6. react-native-vector-icons

    Customizable Icons for React Native with support for image source and full styling.

    I got this error when I was importing from a library such as react-native-vector-icons:

  7. jest

    Delightful JavaScript Testing.

    console.error Jest encountered an unexpected token Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax. Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration. By default "node\_modules" folder is ignored by transformers. Here's what you can do: • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it. • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript • To have some of your "node\_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config. • If you need a custom transformation specify a "transform" option in your config. • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option. You'll find more details and examples of these config options in the docs: https://jestjs.io/docs/configuration For information about custom transformations, see: https://jestjs.io/docs/code-transformation

  8. react-native-testing-library

    🦉 Simple and complete React Native testing utilities that encourage good testing practices.

    Testing library: @testing-library/react-native

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Fundamentals of React Native App Development: Dependencies, Performance, Native Modules, and Publishing Guide

    13 projects | dev.to | 5 Oct 2024
  • 🚀 Introducing NextSolution V2: ASP.NET API + Next.js + Expo Starter Template

    27 projects | dev.to | 7 Sep 2024
  • Unit Tests using jest and react-native-testing-library.

    1 project | /r/reactnative | 1 Jul 2023
  • Is there a way to automatically find UI related/CSS bugs, something that works like unit testing but it's UI?

    4 projects | /r/Frontend | 27 Apr 2023
  • Starting React Native Project in 2023

    13 projects | dev.to | 6 Jan 2023

Did you know that TypeScript is
the 1st most popular programming language
based on number of references?