Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
31K
decreased by-19.14%
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

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