find-cypress-specs 1.38.0 → 1.38.2
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 +2 -2
- package/package.json +4 -4
- package/src/count.js +20 -1
- package/src/print.js +9 -2
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
|
|
|
@@ -182,7 +182,7 @@ Tag Tests
|
|
|
182
182
|
@user 2
|
|
183
183
|
```
|
|
184
184
|
|
|
185
|
-
Each tag count includes the tests that use the tag directly, and the _effective_ tags applied from the parent suites
|
|
185
|
+
Each tag count includes the tests that use the tag directly, and the _effective_ tags applied from the parent suites, both `tags` and `requiredTags`.
|
|
186
186
|
|
|
187
187
|
You can print the results in JSON format using `--json` or `-j` option.
|
|
188
188
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "find-cypress-specs",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.2",
|
|
4
4
|
"description": "Find Cypress spec files using the config settings",
|
|
5
5
|
"main": "src",
|
|
6
6
|
"files": [
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"homepage": "https://github.com/bahmutov/find-cypress-specs#readme",
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"ava": "^4.0.0",
|
|
58
|
-
"cypress": "13.6.
|
|
58
|
+
"cypress": "13.6.2",
|
|
59
59
|
"dependency-version-badge": "^1.11.0",
|
|
60
60
|
"execa-wrap": "^1.4.0",
|
|
61
61
|
"prettier": "^2.5.1",
|
|
62
62
|
"really-need": "^1.9.2",
|
|
63
|
-
"semantic-release": "22.0.
|
|
63
|
+
"semantic-release": "22.0.12",
|
|
64
64
|
"sinon": "^13.0.1",
|
|
65
65
|
"typescript": "^4.6.3"
|
|
66
66
|
},
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"arg": "^5.0.1",
|
|
70
70
|
"console.table": "^0.10.0",
|
|
71
71
|
"debug": "^4.3.3",
|
|
72
|
-
"find-test-names": "1.28.
|
|
72
|
+
"find-test-names": "1.28.15",
|
|
73
73
|
"globby": "^11.1.0",
|
|
74
74
|
"minimatch": "^3.0.4",
|
|
75
75
|
"pluralize": "^8.0.0",
|
package/src/count.js
CHANGED
|
@@ -53,4 +53,23 @@ function countPendingTests(testsOrSuites) {
|
|
|
53
53
|
}, 0)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Goes through the object with all specs and adds up
|
|
58
|
+
* all test counts to find the total number of tests
|
|
59
|
+
* and the total number of pending tests
|
|
60
|
+
*/
|
|
61
|
+
function sumTestCounts(allInfo) {
|
|
62
|
+
const counts = {
|
|
63
|
+
tests: 0,
|
|
64
|
+
pending: 0,
|
|
65
|
+
}
|
|
66
|
+
Object.keys(allInfo).forEach((fileName) => {
|
|
67
|
+
const fileInfo = allInfo[fileName]
|
|
68
|
+
counts.tests += fileInfo.counts.tests
|
|
69
|
+
counts.pending += fileInfo.counts.pending
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return counts
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = { addCounts, sumTestCounts }
|
package/src/print.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const pluralize = require('pluralize')
|
|
2
2
|
const { formatTestList } = require('find-test-names')
|
|
3
|
+
const { sumTestCounts } = require('./count')
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Outputs a string representation of the json test results object,
|
|
@@ -93,9 +94,15 @@ function getJustTheTestNames(tests, parentName = '', justNames = []) {
|
|
|
93
94
|
* @returns {string}
|
|
94
95
|
*/
|
|
95
96
|
function stringMarkdownTests(allInfo) {
|
|
97
|
+
const counts = sumTestCounts(allInfo)
|
|
98
|
+
const specNames = Object.keys(allInfo)
|
|
99
|
+
const specWord = pluralize('Spec', specNames.length, true)
|
|
100
|
+
const testWord = pluralize('test', counts.tests, true)
|
|
101
|
+
|
|
102
|
+
const title = `| ${specWord} with ${testWord} |\n| --- |\n`
|
|
96
103
|
const allInfoString =
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
title +
|
|
105
|
+
specNames
|
|
99
106
|
.map((fileName) => {
|
|
100
107
|
const fileInfo = allInfo[fileName]
|
|
101
108
|
const n = fileInfo.counts.tests
|