find-cypress-specs 1.37.0 → 1.37.1
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.
- package/README.md +4 -2
- package/bin/find.js +6 -1
- package/package.json +4 -3
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# find-cypress-specs [![renovate-app badge][renovate-badge]][renovate-app]  [](https://github.com/bahmutov/find-cypress-specs/actions/workflows/ci.yml)
|
|
2
2
|
|
|
3
3
|
> Find Cypress spec files using the config settings
|
|
4
4
|
|
|
@@ -200,10 +200,12 @@ $ npx find-cypress-specs --tagged <single tag>
|
|
|
200
200
|
# cypress/e2e/spec.cy.js,cypress/e2e/featureA/user.cy.ts
|
|
201
201
|
```
|
|
202
202
|
|
|
203
|
+
If you pass an empty string argument like `--tagged ''`, an empty list is returned.
|
|
204
|
+
|
|
203
205
|
You can print the number of found tagged specs by adding `--count` argument
|
|
204
206
|
|
|
205
207
|
```
|
|
206
|
-
$ npx find-cypress-specs --tagged <single tag>
|
|
208
|
+
$ npx find-cypress-specs --tagged <single tag> --count
|
|
207
209
|
3
|
|
208
210
|
```
|
|
209
211
|
|
package/bin/find.js
CHANGED
|
@@ -85,6 +85,10 @@ if (args['--test-counts']) {
|
|
|
85
85
|
|
|
86
86
|
const specs = getSpecs(undefined, specType)
|
|
87
87
|
|
|
88
|
+
// if the user passes "--tagged ''" we want to find the specs
|
|
89
|
+
// but then filter them all out
|
|
90
|
+
const isTaggedPresent = args['--tagged'] || args['--tagged'] === ''
|
|
91
|
+
|
|
88
92
|
if (args['--branch']) {
|
|
89
93
|
debug('determining specs changed against branch %s', args['--branch'])
|
|
90
94
|
let changedFiles = findChangedFiles(args['--branch'], args['--parent'])
|
|
@@ -191,8 +195,9 @@ if (args['--test-counts']) {
|
|
|
191
195
|
} else {
|
|
192
196
|
console.log(changedSpecs.join(','))
|
|
193
197
|
}
|
|
194
|
-
} else if (args['--names'] || args['--tags'] ||
|
|
198
|
+
} else if (args['--names'] || args['--tags'] || isTaggedPresent) {
|
|
195
199
|
// counts the number of tests for each tag across all specs
|
|
200
|
+
debug('count number of tests')
|
|
196
201
|
const { jsonResults, tagTestCounts } = getTests(specs, {
|
|
197
202
|
tags: args['--tags'],
|
|
198
203
|
tagged: args['--tagged'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "find-cypress-specs",
|
|
3
|
-
"version": "1.37.
|
|
3
|
+
"version": "1.37.1",
|
|
4
4
|
"description": "Find Cypress spec files using the config settings",
|
|
5
5
|
"main": "src",
|
|
6
6
|
"files": [
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"demo-names-and-tags-json": "node ./bin/find --names --tags --json",
|
|
26
26
|
"demo-names-json": "node ./bin/find --names --json",
|
|
27
27
|
"demo-names-tagged": "node ./bin/find --names --tagged @user",
|
|
28
|
+
"demo-tagged-empty-string": "node ./bin/find --tagged ''",
|
|
28
29
|
"demo-subfolder": "DEBUG=find-cypress-specs CYPRESS_CONFIG_FILE=mocks/my-app/e2e/cypress.config.js node ./bin/find --names",
|
|
29
30
|
"print-changed-specs": "node ./bin/find --branch main",
|
|
30
31
|
"count-changed-specs": "node ./bin/find --branch main --count",
|
|
@@ -53,12 +54,12 @@
|
|
|
53
54
|
"homepage": "https://github.com/bahmutov/find-cypress-specs#readme",
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"ava": "^4.0.0",
|
|
56
|
-
"cypress": "13.
|
|
57
|
+
"cypress": "13.5.1",
|
|
57
58
|
"dependency-version-badge": "^1.11.0",
|
|
58
59
|
"execa-wrap": "^1.4.0",
|
|
59
60
|
"prettier": "^2.5.1",
|
|
60
61
|
"really-need": "^1.9.2",
|
|
61
|
-
"semantic-release": "22.0.
|
|
62
|
+
"semantic-release": "22.0.7",
|
|
62
63
|
"sinon": "^13.0.1",
|
|
63
64
|
"typescript": "^4.6.3"
|
|
64
65
|
},
|
package/src/index.js
CHANGED
|
@@ -449,7 +449,7 @@ function getTests(specs, options = {}) {
|
|
|
449
449
|
debug('added counts')
|
|
450
450
|
debug(jsonResults)
|
|
451
451
|
|
|
452
|
-
if (tagged) {
|
|
452
|
+
if (tagged || tagged === '') {
|
|
453
453
|
// filter all collected tests to those that have the given tag(s)
|
|
454
454
|
const splitTags = tagged
|
|
455
455
|
.split(',')
|