Socket
Socket
Sign inDemoInstall

react-native-crash-tester

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-crash-tester

Deliberately crash your app. Good for testing crash reporting services.


Version published
Weekly downloads
963
decreased by-8.2%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

0.2.3 (2022-11-03)

Bug Fixes

  • replace jCenter with mavenCentral (22e8abc)

Readme

Source

react-native-crash-tester

Deliberately crash your app. Good for testing crash reporting services.

Installation

npm install react-native-crash-tester

or

yarn add react-native-crash-tester

Usage

Trigger a Native Crash

import CrashTester from 'react-native-crash-tester';

CrashTester.nativeCrash();
CrashTester.nativeCrash('Custom message!');

Trigger a JavaScript Crash

import CrashTester from 'react-native-crash-tester';

CrashTester.jsCrash();
CrashTester.jsCrash('Custom message!');

Test a React Error Boundary

import * as React from 'react';
import { Button } from 'react-native';
import { CrashingComponent } from 'react-native-crash-tester';
import ErrorBoundary from './MyErrorBoundary';

function TestComponent() {
  const [shown, setShown] = React.useState(false);

  <ErrorBoundary>
    <Button title="Crash" onPress={() => setShown(true)} />
    {shown && <CrashingComponent />}
  </ErrorBoundary>;
}

You can run the app in ./example to see sample usage.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Keywords

FAQs

Last updated on 03 Nov 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc