qase-javascript-commons 2.6.0 → 2.6.1

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/changelog.md CHANGED
@@ -1,3 +1,9 @@
1
+ # qase-javascript-commons@2.6.1
2
+
3
+ ## Bug fixes
4
+
5
+ - Fixed Cypress test failures being classified as `invalid` instead of `failed`. Cypress uses retry-ability (`Timed out retrying after Nms: ...`) and command syntax (`cy.click() failed`, `cy.wait() timed out`) that don't contain the word `expect`, so genuine UI/command failures previously fell through to the timeout catch-all and were mislabeled as environment errors. `cy.request()` with infrastructure-level errors (e.g. `ECONNREFUSED`) continues to be classified as `invalid`.
6
+
1
7
  # qase-javascript-commons@2.6.0
2
8
 
3
9
  ## What's new
@@ -90,6 +90,21 @@ function isAssertionError(error, originalStatus) {
90
90
  }
91
91
  return false;
92
92
  }
93
+ // Cypress-specific failure detection.
94
+ // Cypress uses retry-ability and command-based error syntax that don't contain
95
+ // the word "expect" (unlike Jest/Playwright assertions). Without this branch,
96
+ // genuine UI/command failures fall through to the "timeout → invalid" catch-all
97
+ // below and get misclassified as environment errors.
98
+ //
99
+ // Why this order: the hasNonAssertionPattern check above already returned
100
+ // invalid for cy.request() failures (which contain "network"/"connection"),
101
+ // so reaching this point with a Cypress signature means the error has no
102
+ // infrastructure markers — the test app failed to behave as expected.
103
+ const isCypressRetryTimeout = /timed out retrying after \d+ms/.test(errorMessage);
104
+ const isCypressCommandFailure = /cy\.\w+\(\)\s+(failed|timed out)/.test(errorMessage);
105
+ if (isCypressRetryTimeout || isCypressCommandFailure) {
106
+ return true;
107
+ }
93
108
  // For timeout errors without expect, treat as invalid
94
109
  if (errorMessage.includes('timeout')) {
95
110
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",