You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

babel-plugin-react-test-id

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-test-id

Babel plugin for dealing with test ID props in your components

1.0.2
latest
npmnpm
Version published
Weekly downloads
19K
-20.93%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-react-test-id

This plugin removes testID props from your components. It's indented to be run for production/ development builds to prevent test-related data from being included in your bundle.

Example

In

<MyComponent testID="foo" disabled />

Out

<MyComponent disabled />

Installation

# yarn
yarn add --dev babel-plugin-react-test-id

# npm
npm install --save-dev babel-plugin-react-test-id

Usage

.babelrc

{
  "plugins": ["react-test-id"]
}

Via CLI

babel --plugins react-test-id script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['react-test-id'],
});

Options

This plugin accepts an options object with a single option: props, an array of strings representing the names of props you would like to remove (defaults to ['testID']).

FAQs

Package last updated on 04 Jun 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