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

grep-tests-from-pull-requests

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grep-tests-from-pull-requests - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"name": "grep-tests-from-pull-requests",
"version": "1.0.0",
"version": "1.0.1",
"description": "Grabs the test tags to run from the pull request text",
"main": "index.js",
"main": "src/index.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "echo \"Error: no test specified\" && exit 1",

@@ -5,2 +5,39 @@ # grep-tests-from-pull-requests

## Install
```shell
# 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](https://github.com/cypress-io/cypress-grep) registration.
```js
// 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.
## Small print

@@ -7,0 +44,0 @@

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