find-cypress-specs 1.27.2 → 1.27.3
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/package.json +1 -1
- package/src/index.js +28 -22
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -340,28 +340,34 @@ function getTests(specs, options = {}) {
|
|
|
340
340
|
const jsonResults = {}
|
|
341
341
|
|
|
342
342
|
specs.forEach((filename) => {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
343
|
+
try {
|
|
344
|
+
const source = fs.readFileSync(filename, 'utf8')
|
|
345
|
+
const result = getTestNames(source, true)
|
|
346
|
+
|
|
347
|
+
jsonResults[filename] = {
|
|
348
|
+
counts: {
|
|
349
|
+
tests: 0,
|
|
350
|
+
pending: 0,
|
|
351
|
+
},
|
|
352
|
+
tests: [],
|
|
353
|
+
}
|
|
354
|
+
// enable if need to debug the parsed test
|
|
355
|
+
// console.dir(result.structure, { depth: null })
|
|
356
|
+
collectResults(result.structure, jsonResults[filename].tests)
|
|
357
|
+
|
|
358
|
+
if (tags) {
|
|
359
|
+
const specTagCounts = countTags(result.structure)
|
|
360
|
+
Object.keys(specTagCounts).forEach((tag) => {
|
|
361
|
+
if (!(tag in tagTestCounts)) {
|
|
362
|
+
tagTestCounts[tag] = specTagCounts[tag]
|
|
363
|
+
} else {
|
|
364
|
+
tagTestCounts[tag] += specTagCounts[tag]
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
}
|
|
368
|
+
} catch (e) {
|
|
369
|
+
console.error('find-cypress-specs: problem parsing file %s', filename)
|
|
370
|
+
delete jsonResults[filename]
|
|
365
371
|
}
|
|
366
372
|
})
|
|
367
373
|
|