qase-javascript-commons 2.4.7 → 2.4.8

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.4.8
2
+
3
+ ## What's new
4
+
5
+ Improved error handling for timeout errors.
6
+
1
7
  # qase-javascript-commons@2.4.7
2
8
 
3
9
  ## Bug fixes
@@ -67,11 +67,22 @@ function isAssertionError(error) {
67
67
  'server error',
68
68
  'internal error'
69
69
  ];
70
- // Check for non-assertion patterns first
71
- const hasNonAssertionPattern = nonAssertionPatterns.some(pattern => errorMessage.includes(pattern) || errorStack.includes(pattern));
70
+ // Special case: timeout errors with expect should be treated as assertion errors
71
+ const isTimeoutWithExpect = errorMessage.includes('timeout') &&
72
+ errorMessage.includes('expect');
73
+ if (isTimeoutWithExpect) {
74
+ return true;
75
+ }
76
+ // Check for non-assertion patterns (excluding timeout for special handling above)
77
+ const nonAssertionPatternsWithoutTimeout = nonAssertionPatterns.filter(pattern => pattern !== 'timeout');
78
+ const hasNonAssertionPattern = nonAssertionPatternsWithoutTimeout.some(pattern => errorMessage.includes(pattern) || errorStack.includes(pattern));
72
79
  if (hasNonAssertionPattern) {
73
80
  return false;
74
81
  }
82
+ // For timeout errors without expect, treat as invalid
83
+ if (errorMessage.includes('timeout')) {
84
+ return false;
85
+ }
75
86
  // Check error message and stack for assertion patterns
76
87
  const hasAssertionPattern = assertionPatterns.some(pattern => errorMessage.includes(pattern) || errorStack.includes(pattern));
77
88
  // Check for specific error types that indicate assertions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",