find-cypress-specs 1.27.1 → 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 +29 -22
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -159,6 +159,7 @@ function findCypressSpecsV10(opts = {}, type = 'e2e') {
|
|
|
159
159
|
if (type === 'component') {
|
|
160
160
|
const e2eIgnorePattern = options.e2e?.specPattern || e2eDefaults.specPattern
|
|
161
161
|
ignorePatterns.push(e2eIgnorePattern)
|
|
162
|
+
ignorePatterns.push('node_modules/**')
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
debug('ignore patterns %o', ignorePatterns)
|
|
@@ -339,28 +340,34 @@ function getTests(specs, options = {}) {
|
|
|
339
340
|
const jsonResults = {}
|
|
340
341
|
|
|
341
342
|
specs.forEach((filename) => {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
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]
|
|
364
371
|
}
|
|
365
372
|
})
|
|
366
373
|
|