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.
@@ -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
- // Filter suites to only include tests with matching exact titles
219
- for (const suite of mocha.suite.suites) {
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.includes(test.title)
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
- // Remove empty suites
226
- mocha.suite.suites = mocha.suite.suites.filter(suite => suite.tests.length > 0)
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.includes(test.title)
327
+ shouldInclude = exactTestTitles.some(title => title === test.title)
328
328
  }
329
329
 
330
330
  if (shouldInclude) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "3.7.5-beta.12",
3
+ "version": "3.7.5-beta.14",
4
4
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
5
5
  "keywords": [
6
6
  "acceptance",