Skip to content

Commit 7a18b79

Browse files
fix(grep): references to cypress-grep (#26108)
* fix(grep): references to cypress-grep * Update npm/grep/README.md Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> --------- Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
1 parent dbf4ff8 commit 7a18b79

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

npm/grep/README.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ All other tests will be marked pending, see why in the [Cypress test statuses](h
1919

2020
If you have multiple spec files, all specs will be loaded, and every test will be filtered the same way, since the grep is run-time operation and cannot eliminate the spec files without loading them. If you want to run only specific tests, use the built-in [--spec](https://on.cypress.io/command-line#cypress-run-spec-lt-spec-gt) CLI argument.
2121

22-
Watch the video [intro to cypress-grep plugin](https://www.youtube.com/watch?v=HS-Px-Sghd8)
22+
Watch the video [intro to @cypress/grep plugin](https://www.youtube.com/watch?v=HS-Px-Sghd8)
2323

2424
Table of Contents
2525

@@ -499,18 +499,18 @@ Cypress.grep('hello', '@smoke', 10)
499499

500500
## Debugging
501501

502-
When debugging a problem, first make sure you are using the expected version of this plugin, as some features might be only available in the [later releases](https://github.com/cypress-io/cypress-grep/releases).
502+
When debugging a problem, first make sure you are using the expected version of this plugin, as some features might be only available in the [later releases](https://www.npmjs.com/package/@cypress/grep?activeTab=versions).
503503

504504
```
505-
# get the cypress-grep version using NPM
506-
$ npm ls cypress-grep
505+
# get the @cypress/grep version using NPM
506+
$ npm ls @cypress/grep
507507
...
508-
└── cypress-grep@2.10.1
509-
# get the cypress-grep version using Yarn
510-
$ yarn why cypress-grep
508+
└── @cypress/grep@2.10.1
509+
# get the @cypress/grep version using Yarn
510+
$ yarn why @cypress/grep
511511
...
512-
=> Found "cypress-grep@2.10.1"
513-
info Has been hoisted to "cypress-grep"
512+
=> Found "@cypress/grep@3.1.0"
513+
info Has been hoisted to "@cypress/grep"
514514
info This module exists because it's specified in "devDependencies".
515515
...
516516
```
@@ -531,30 +531,30 @@ This module uses [debug](https://github.com/visionmedia/debug#readme) to log ver
531531

532532
### Debugging in the plugin
533533

534-
Start Cypress with the environment variable `DEBUG=cypress-grep`. You will see a few messages from this plugin in the terminal output:
534+
Start Cypress with the environment variable `DEBUG=@cypress/grep`. You will see a few messages from this plugin in the terminal output:
535535

536536
```
537-
$ DEBUG=cypress-grep npx cypress run --env grep=works,grepFilterSpecs=true
538-
cypress-grep: tests with "works" in their names
539-
cypress-grep: filtering specs using "works" in the title
540-
cypress-grep Cypress config env object: { grep: 'works', grepFilterSpecs: true }
537+
$ DEBUG=@cypress/grep npx cypress run --env grep=works,grepFilterSpecs=true
538+
@cypress/grep: tests with "works" in their names
539+
@cypress/grep: filtering specs using "works" in the title
540+
@cypress/grep Cypress config env object: { grep: 'works', grepFilterSpecs: true }
541541
...
542-
cypress-grep found 1 spec files +5ms
543-
cypress-grep [ 'spec.js' ] +0ms
544-
cypress-grep spec file spec.js +5ms
545-
cypress-grep suite and test names: [ 'hello world', 'works', 'works 2 @tag1',
542+
@cypress/grep found 1 spec files +5ms
543+
@cypress/grep [ 'spec.js' ] +0ms
544+
@cypress/grep spec file spec.js +5ms
545+
@cypress/grep suite and test names: [ 'hello world', 'works', 'works 2 @tag1',
546546
'works 2 @tag1 @tag2', 'works @tag2' ] +0ms
547-
cypress-grep found "works" in 1 specs +0ms
548-
cypress-grep [ 'spec.js' ] +0ms
547+
@cypress/grep found "works" in 1 specs +0ms
548+
@cypress/grep [ 'spec.js' ] +0ms
549549
```
550550

551551
### Debugging in the browser
552552

553-
To enable debug console messages in the browser, from the DevTools console set `localStorage.debug='cypress-grep'` and run the tests again.
553+
To enable debug console messages in the browser, from the DevTools console set `localStorage.debug='@cypress/grep'` and run the tests again.
554554

555555
![Debug messages](./images/debug.png)
556556

557-
To see how to debug this plugin, watch the video [Debug cypress-grep Plugin](https://youtu.be/4YMAERddHYA).
557+
To see how to debug this plugin, watch the video [Debug @cypress/grep Plugin](https://youtu.be/4YMAERddHYA).
558558

559559
## Examples
560560

@@ -595,11 +595,11 @@ The above scenario was confusing - did you want to find all tests with title con
595595

596596
### from v2 to v3
597597

598-
Version >= 3 of cypress-grep _only_ supports Cypress >= 10.
598+
Version >= 3 of @cypress/grep _only_ supports Cypress >= 10.
599599

600600
## Small Print
601601

602602
License: MIT - do anything with the code, but don't blame me if it does not work.
603603

604604
Support: if you find any problems with this module, email / tweet /
605-
[open issue](https://github.com/cypress-io/cypress/issues) on Github
605+
[open issue](https://github.com/cypress-io/cypress/issues) on Github.

npm/grep/src/plugin.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
const debug = require('debug')('cypress-grep')
1+
const debug = require('debug')('@cypress/grep')
22
const globby = require('globby')
33
const { getTestNames } = require('find-test-names')
44
const fs = require('fs')
55
const { version } = require('../package.json')
66
const { parseGrep, shouldTestRun } = require('./utils')
77

88
/**
9-
* Prints the cypress-grep environment values if any.
9+
* Prints the @cypress/grep environment values if any.
1010
* @param {Cypress.ConfigOptions} config
1111
*/
1212
function cypressGrepPlugin (config) {
@@ -18,23 +18,23 @@ function cypressGrepPlugin (config) {
1818

1919
if (!config.specPattern) {
2020
throw new Error(
21-
'Incompatible versions detected, cypress-grep 3.0.0+ requires Cypress 10.0.0+',
21+
'Incompatible versions detected, @cypress/grep 3.0.0+ requires Cypress 10.0.0+',
2222
)
2323
}
2424

25-
debug('cypress-grep plugin version %s', version)
25+
debug('@cypress/grep plugin version %s', version)
2626
debug('Cypress config env object: %o', env)
2727

2828
const grep = env.grep ? String(env.grep) : undefined
2929

3030
if (grep) {
31-
console.log('cypress-grep: tests with "%s" in their names', grep.trim())
31+
console.log('@cypress/grep: tests with "%s" in their names', grep.trim())
3232
}
3333

3434
const grepTags = env.grepTags || env['grep-tags']
3535

3636
if (grepTags) {
37-
console.log('cypress-grep: filtering using tag(s) "%s"', grepTags)
37+
console.log('@cypress/grep: filtering using tag(s) "%s"', grepTags)
3838
const parsedGrep = parseGrep(null, grepTags)
3939

4040
debug('parsed grep tags %o', parsedGrep.tags)
@@ -43,19 +43,19 @@ function cypressGrepPlugin (config) {
4343
const grepBurn = env.grepBurn || env['grep-burn'] || env.burn
4444

4545
if (grepBurn) {
46-
console.log('cypress-grep: running filtered tests %d times', grepBurn)
46+
console.log('@cypress/grep: running filtered tests %d times', grepBurn)
4747
}
4848

4949
const grepUntagged = env.grepUntagged || env['grep-untagged']
5050

5151
if (grepUntagged) {
52-
console.log('cypress-grep: running untagged tests')
52+
console.log('@cypress/grep: running untagged tests')
5353
}
5454

5555
const omitFiltered = env.grepOmitFiltered || env['grep-omit-filtered']
5656

5757
if (omitFiltered) {
58-
console.log('cypress-grep: will omit filtered tests')
58+
console.log('@cypress/grep: will omit filtered tests')
5959
}
6060

6161
const { specPattern, excludeSpecPattern } = config
@@ -78,7 +78,7 @@ function cypressGrepPlugin (config) {
7878
let greppedSpecs = []
7979

8080
if (grep) {
81-
console.log('cypress-grep: filtering specs using "%s" in the title', grep)
81+
console.log('@cypress/grep: filtering specs using "%s" in the title', grep)
8282
const parsedGrep = parseGrep(grep)
8383

8484
debug('parsed grep %o', parsedGrep)

npm/grep/src/support.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const _describe = describe
1414

1515
/**
1616
* Wraps the "it" and "describe" functions that support tags.
17-
* @see https://github.com/cypress-io/cypress-grep
17+
* @see https://github.com/cypress-io/cypress/tree/develop/npm/grep
1818
*/
1919
function cypressGrep () {
2020
/** @type {string} Part of the test title go grep */
@@ -63,7 +63,7 @@ function cypressGrep () {
6363
// prevent multiple registrations
6464
// https://github.com/cypress-io/cypress-grep/issues/59
6565
if (it.name === 'itGrep') {
66-
debug('already registered cypress-grep')
66+
debug('already registered @cypress/grep')
6767

6868
return
6969
}
@@ -228,7 +228,7 @@ if (!Cypress.grep) {
228228
* // remove all current grep settings
229229
* // and run all tests
230230
* Cypress.grep()
231-
* @see "Grep from DevTools console" https://github.com/cypress-io/cypress-grep#devtools-console
231+
* @see "Grep from DevTools console" https://github.com/cypress-io/cypress/tree/develop/npm/grep#devtools-console
232232
*/
233233
Cypress.grep = function grep (grep, tags, burn) {
234234
Cypress.env('grep', grep)

0 commit comments

Comments
 (0)