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

babel-plugin-autotest

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-autotest

[![Travis branch](https://img.shields.io/travis/lttb/babel-plugin-autotest/master.svg?style=flat)](https://travis-ci.org/lttb/babel-plugin-autotest) [![Coverage Status branch](https://img.shields.io/coveralls/lttb/babel-plugin-autotest/master.svg?style=fl

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-autotest

Travis branch Coverage Status branch npm version npm license

Usage

Add babel-plugin-autotest to plugin list in .babelrc. For example:

{
    presets: ['react'],
    env: {
        test: {
            plugins: [
                'autotest',
            ],
        },
    },
}

Use get function to build any css selector by React Components.

import {get} from 'babel-plugin-autotest'

import MyComponent from './MyComponent'
import MyButton from './MyButton'

/**
 * [data-dadad] [data-czczx]
 */
console.log(get`${MyComponent} ${MyButton}`)

/**
 * .myClassName > [data-czczx]
 */
console.log(get`.myClassName > ${MyButton}`)

How it works

This plugin tries to find all React Component declarations and to add data-{hash} attribute with the uniq hash-id to the Component's root node. It also saves this hash as the static property for the Component, so get function uses this property to build a selector.

FAQs

Package last updated on 07 Feb 2018

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