find-cypress-specs 1.30.2 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/bin/find.js +16 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,6 +10,15 @@ cypress/e2e/spec.js,cypress/e2e/featureA/user.js
10
10
 
11
11
  Supports JS and TS specs
12
12
 
13
+ ## Count
14
+
15
+ You can count the number of specs found
16
+
17
+ ```bash
18
+ $ npx find-cypress-specs --count
19
+ 2
20
+ ```
21
+
13
22
  ## Component specs
14
23
 
15
24
  By default, it finds the E2E specs and tests. You can find component specs using `--component` CLI option
@@ -170,6 +179,13 @@ $ npx find-cypress-specs --tagged <single tag>
170
179
  # cypress/e2e/spec.cy.js,cypress/e2e/featureA/user.cy.ts
171
180
  ```
172
181
 
182
+ You can print the number of found tagged specs by adding `--count` argument
183
+
184
+ ```
185
+ $ npx find-cypress-specs --tagged <single tag>
186
+ 3
187
+ ```
188
+
173
189
  ## File names filtered by multiple tags
174
190
 
175
191
  ```
package/bin/find.js CHANGED
@@ -105,9 +105,15 @@ if (args['--names'] || args['--tags'] || args['--tagged']) {
105
105
  }
106
106
 
107
107
  if (!args['--names'] && !args['--tags']) {
108
- debug('printing the spec names list only')
109
- const specNames = Object.keys(jsonResults).join(',')
110
- console.log(specNames)
108
+ const specs = Object.keys(jsonResults)
109
+ if (args['--count']) {
110
+ debug('printing the number of specs %d', specs.length)
111
+ console.log(specs.length)
112
+ } else {
113
+ debug('printing the spec names list only')
114
+ const specNames = specs.join(',')
115
+ console.log(specNames)
116
+ }
111
117
  }
112
118
  } else if (args['--branch']) {
113
119
  debug('determining specs changed against branch %s', args['--branch'])
@@ -206,6 +212,11 @@ if (args['--names'] || args['--tags'] || args['--tagged']) {
206
212
  console.log(changedSpecs.join(','))
207
213
  }
208
214
  } else {
209
- debug('printing just %d spec names', specs.length)
210
- console.log(specs.join(','))
215
+ if (args['--count']) {
216
+ debug('printing the number of specs %d', specs.length)
217
+ console.log(specs.length)
218
+ } else {
219
+ debug('printing just %d spec names', specs.length)
220
+ console.log(specs.join(','))
221
+ }
211
222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.30.2",
3
+ "version": "1.31.0",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [