New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cypress-grep

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-grep - npm Package Compare versions

Comparing version 2.9.3 to 2.10.0

2

package.json
{
"name": "cypress-grep",
"version": "2.9.3",
"version": "2.10.0",
"description": "Filter tests using substring",

@@ -5,0 +5,0 @@ "main": "src/support",

@@ -220,2 +220,32 @@ # cypress-grep

### omit filtered tests
By default, all filtered tests are made _pending_ using `it.skip` method. If you want to completely omit them, pass the environment variable `grepOmitFiltered=true`.
Pending filtered tests
```
cypress run --env grep="works 2"
```
![Pending tests](./images/includes-pending.png)
Omit filtered tests
```
cypress run --env grep="works 2",grepOmitFiltered=true
```
![Only running tests remaining](./images/omit-pending.png)
**Tip:** you can set this environment variable in the `cypress.json` file to enable it by default and skip using the environment variable:
```json
{
"env": {
"grepOmitFiltered": true
}
}
```
### grep untagged tests

@@ -222,0 +252,0 @@

@@ -38,2 +38,8 @@ const debug = require('debug')('cypress-grep')

const omitFiltered =
config.env.grepOmitFiltered || config.env['grep-omit-filtered']
if (omitFiltered) {
console.log('cypress-grep: will omit filtered tests')
}
const grepFilterSpecs = config.env.grepFilterSpecs === true

@@ -40,0 +46,0 @@ if (grepFilterSpecs) {

@@ -45,3 +45,7 @@ // @ts-check

debug('grep %o', { grep, grepTags, grepBurn })
/** @type {boolean} Omit filtered tests completely */
const omitFiltered =
Cypress.env('grepOmitFiltered') || Cypress.env('grep-omit-filtered')
debug('grep %o', { grep, grepTags, grepBurn, omitFiltered })
if (!Cypress._.isInteger(grepBurn) || grepBurn < 1) {

@@ -116,4 +120,9 @@ throw new Error(`Invalid grep burn value: ${grepBurn}`)

// skip tests without grep string in their names
return _it.skip(name, options, callback)
if (omitFiltered) {
// omit the filtered tests completely
return
} else {
// skip tests without grep string in their names
return _it.skip(name, options, callback)
}
}

@@ -120,0 +129,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