codeceptjs 3.7.5-beta.12 → 3.7.5-beta.14
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/lib/command/run-failed-tests.js +17 -5
- package/lib/workers.js +2 -2
- package/package.json +1 -1
|
@@ -215,15 +215,27 @@ async function runWithoutWorkers(config, options, testPatterns, failedTestsData,
|
|
|
215
215
|
const Container = require('../container')
|
|
216
216
|
const mocha = Container.mocha()
|
|
217
217
|
|
|
218
|
-
//
|
|
219
|
-
|
|
218
|
+
// Ensure tests are loaded into mocha suite structure
|
|
219
|
+
mocha.loadFiles()
|
|
220
|
+
|
|
221
|
+
// Filter all tests recursively through the suite hierarchy
|
|
222
|
+
const filterSuite = (suite) => {
|
|
223
|
+
// Filter direct tests in this suite
|
|
220
224
|
suite.tests = suite.tests.filter(test => {
|
|
221
|
-
return options.exactTestTitles.
|
|
225
|
+
return options.exactTestTitles.some(title => title === test.title)
|
|
222
226
|
})
|
|
227
|
+
|
|
228
|
+
// Recursively filter child suites
|
|
229
|
+
suite.suites.forEach(childSuite => filterSuite(childSuite))
|
|
230
|
+
|
|
231
|
+
// Remove empty child suites
|
|
232
|
+
suite.suites = suite.suites.filter(childSuite =>
|
|
233
|
+
childSuite.tests.length > 0 || childSuite.suites.length > 0
|
|
234
|
+
)
|
|
223
235
|
}
|
|
224
236
|
|
|
225
|
-
//
|
|
226
|
-
mocha.suite
|
|
237
|
+
// Start filtering from the root suite
|
|
238
|
+
filterSuite(mocha.suite)
|
|
227
239
|
|
|
228
240
|
output.print(`Filtered to ${options.exactTestTitles.length} specific failed tests by exact title matching`)
|
|
229
241
|
}
|
package/lib/workers.js
CHANGED
|
@@ -322,9 +322,9 @@ class Workers extends EventEmitter {
|
|
|
322
322
|
if (targetTests && targetTests.length > 0) {
|
|
323
323
|
shouldInclude = targetTests.includes(test.uid)
|
|
324
324
|
}
|
|
325
|
-
// If we have exact test titles, only include tests with matching titles
|
|
325
|
+
// If we have exact test titles, only include tests with exact matching titles
|
|
326
326
|
else if (exactTestTitles && exactTestTitles.length > 0) {
|
|
327
|
-
shouldInclude = exactTestTitles.
|
|
327
|
+
shouldInclude = exactTestTitles.some(title => title === test.title)
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
if (shouldInclude) {
|