babel-plugin-autotest
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -32,3 +32,3 @@ 'use strict'; | ||
const id = process.env.NODE_ENV === 'production' ? shortid.generate() : `test-${String(hash++)}`; | ||
const id = process.env.NODE_ENV === 'production' ? shortid.generate().toLowerCase() : `test-${String(hash++)}`; | ||
@@ -35,0 +35,0 @@ openingElement.attributes.push(t.JSXAttribute(t.JSXIdentifier(`data-${id}`))); |
{ | ||
"name": "babel-plugin-autotest", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -34,3 +34,3 @@ # babel-plugin-autotest | ||
/** | ||
* [data-test="dadad"] [data-test="czczxc"] | ||
* [data-dadad] [data-czczx] | ||
*/ | ||
@@ -40,3 +40,3 @@ console.log(get`${MyComponent} ${MyButton}`) | ||
/** | ||
* .myClassName > [data-test="czczxc"] | ||
* .myClassName > [data-czczx] | ||
*/ | ||
@@ -48,2 +48,2 @@ console.log(get`.myClassName > ${MyButton}`) | ||
This plugin tries to find all React Component declarations, and to add `data-test` attribute to the Component's root node with the uniq hash-id. It also saves this id as the static property for this Component, so `get` function uses this property to build a selector. | ||
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. |
6972