Socket
Socket
Sign inDemoInstall

babel-plugin-react-test-id

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
40K
increased by13.46%
Maintainers
1
Install size
3.56 kB
Created
Weekly downloads
 

Readme

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

Last updated on 04 Jun 2017

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