
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
@lukaspolak/react-get-data-cy
Advanced tools
Helper function provides a `data-cy` testing attribute with a value that can match the text content of the react element.
Helper function provides a data-cy testing attribute with a value that can match the text content of the react element.
I wanted to have a dynamic data-cy testing attribute that can be based on children passed to react element. This package supports string, JSX.Element and ReactNode as value i.e. second argument.
To use this package, you only need to install this dependency, import it and invoke the getDataCy function, e.g.:
import { getDataCy } from '@lukaspolak/react-getDataCy'
export const FancyComponent: FC = ({ children }) => {
return <div {...getDataCy('fancy component', children)}>{children}</div>
}
npm install @lukaspolak/react-get-data-cy
or
yarn add @lukaspolak/react-get-data-cy
This package works well with babel-plugin-react-remove-properties. To configure it, update .babelrc file.
{
//...
"env": {
"production": {
"plugins": [["react-remove-properties", { "properties": ["data-cy"] }]]
}
}
//...
}
Please read the Contribution guidelines to start with your awesome contributions!
@lukaspolak/There are a lot of similar libraries/packages on GitHub and npm, that can do the same. I wanted to enhance my programming skills, and I didn't want to find a unique name for the package.
INITIALIZATION TODO sectionREADME.md fileFAQs
Helper function provides a `data-cy` testing attribute with a value that can match the text content of the react element.
We found that @lukaspolak/react-get-data-cy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.