find-cypress-specs 1.9.0 → 1.10.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.
package/README.md CHANGED
@@ -49,6 +49,8 @@ Tag Tests
49
49
 
50
50
  Each tag count includes the tests that use the tag directly, and the _effective_ tags applied from the parent suites.
51
51
 
52
+ You can print the results in JSON format using `--json` or `-j` option.
53
+
52
54
  ## Details
53
55
 
54
56
  Cypress uses the resolved [configuration values](https://on.cypress.io/configuration) to find the spec files to run. It searches the `integrationFolder` for all patterns listed in `testFiles` and removes any files matching the `ignoreTestFiles` patterns.
package/bin/find.js CHANGED
@@ -104,8 +104,14 @@ if (args['--names'] || args['--tags']) {
104
104
  // every entry is [tag, count], so compare the tags
105
105
  return a[0].localeCompare(b[0])
106
106
  })
107
- const table = consoleTable.getTable(['Tag', 'Tests'], sortedTagEntries)
108
- console.log(table)
107
+ if (args['--json']) {
108
+ // assemble a json object with the tag counts
109
+ const tagResults = Object.fromEntries(sortedTagEntries)
110
+ console.log(JSON.stringify(tagResults, null, 2))
111
+ } else {
112
+ const table = consoleTable.getTable(['Tag', 'Tests'], sortedTagEntries)
113
+ console.log(table)
114
+ }
109
115
  }
110
116
  }
111
117
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [
@@ -16,7 +16,9 @@
16
16
  "demo": "DEBUG=find-cypress-specs node ./bin/find",
17
17
  "demo-names": "node ./bin/find --names",
18
18
  "demo-tags": "node ./bin/find --tags",
19
+ "demo-tags-json": "node ./bin/find --tags --json",
19
20
  "demo-names-and-tags": "node ./bin/find --names --tags",
21
+ "demo-names-and-tags-json": "node ./bin/find --names --tags --json",
20
22
  "demo-names-json": "node ./bin/find --names --json",
21
23
  "semantic-release": "semantic-release"
22
24
  },