Unit Testing Expo Apps With Jest

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

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • 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';

  • nx

    Smart Monorepos · Fast CI

  • 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:

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • 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:

  • 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):

  • 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:

  • 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

  • react-native-testing-library

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

  • Testing library: @testing-library/react-native

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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