Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
grep-tests-from-pull-requests
Advanced tools
Grabs the test tags to run from the pull request text
# add this plugin as a dev dependency using NPM
$ npm i -D grep-tests-from-pull-requests
# or using Yarn
$ yarn add -D grep-tests-from-pull-requests
Register the plugin in your plugins file before cypress-grep registration.
// cypress/plugins/index.js
module.exports = async (on, config) => {
// include this plugin before cypress-grep
// so if we find the test tags in the pull request body
// we can grep for them by setting the grep config
await require('grep-tests-from-pull-requests')(on, config, {
// try to find checkbox lines in the pull request body with these tags
tags: ['@log', '@sanity', '@user'],
// repo with the pull request text to read
owner: 'bahmutov',
repo: 'todomvc-no-tests-vercel',
// to get a private repo above, you might need a personal token
token: process.env.PERSONAL_GH_TOKEN || process.env.GITHUB_TOKEN,
})
// cypress-grep plugin registration
// IMPORTANT: the config.env object might be modified
// by the above plugins, thus return the config object from this function
return config
}
Important: notice the plugin registration is an async function, thus you must await the registration. This makes your plugin file function async
. Make sure to return the config
object, as it might be changed by this plugin.
This plugin uses debug module to output verbose log messages. Run with environment variable DEBUG=grep-tests-from-pull-requests
to see those logs.
Author: Gleb Bahmutov © 2022
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2022 Gleb Bahmutov <gleb.bahmutov@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Grabs the test tags to run from the pull request text
The npm package grep-tests-from-pull-requests receives a total of 2,890 weekly downloads. As such, grep-tests-from-pull-requests popularity was classified as popular.
We found that grep-tests-from-pull-requests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.