Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-expo

Package Overview
Dependencies
Maintainers
1
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-expo

A [Jest](https://facebook.github.io/jest/) preset to painlessly test your Expo apps.

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
225K
decreased by-40.81%
Maintainers
1
Weekly downloads
 
Created

What is jest-expo?

The jest-expo package is a set of Jest presets tailored for testing Expo applications. It simplifies the setup and configuration needed to test React Native components and other Expo-specific features, making it easier to write and run tests for Expo projects.

What are jest-expo's main functionalities?

Preset Configuration

The jest-expo package provides a preset configuration that you can use in your Jest configuration file. This preset includes all necessary settings to test Expo applications, such as transforming JavaScript and TypeScript files, handling static assets, and mocking native modules.

module.exports = { preset: 'jest-expo' };

Snapshot Testing

Snapshot testing is a feature that allows you to capture the rendered output of a component and compare it to a reference snapshot file. This helps ensure that your UI does not change unexpectedly.

import React from 'react';
import renderer from 'react-test-renderer';
import App from '../App';

test('App snapshot', () => {
  const tree = renderer.create(<App />).toJSON();
  expect(tree).toMatchSnapshot();
});

Mocking Native Modules

jest-expo makes it easy to mock native modules and Expo-specific APIs, allowing you to test components that rely on these modules without needing a physical device or emulator.

jest.mock('expo-constants', () => ({
  manifest: {
    extra: {
      apiUrl: 'https://api.example.com'
    }
  }
}));

Other packages similar to jest-expo

FAQs

Package last updated on 09 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc