Skip to content

Instantly share code, notes, and snippets.

@scriptschat
Created May 25, 2020 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scriptschat/7d2c9acd0cf51904ec8afdc41551434d to your computer and use it in GitHub Desktop.
Save scriptschat/7d2c9acd0cf51904ec8afdc41551434d to your computer and use it in GitHub Desktop.
/**
* Returns and object with `data-test-id` as key and attributeValue as
* associated value to the key
* @function
* @name getDataTestAttribute
*
* @param {string} attributeValue
* @returns {object}
*/
export function getDataTestAttribute(attributeValue) {
return process.env.NODE_ENV !== "production"
? {
"data-test-id": attributeValue,
}
: {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment