qase-javascript-commons 2.4.6 → 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,15 @@
1
+ # qase-javascript-commons@2.4.8
2
+
3
+ ## What's new
4
+
5
+ Improved error handling for timeout errors.
6
+
7
+ # qase-javascript-commons@2.4.7
8
+
9
+ ## Bug fixes
10
+
11
+ Fixed issue where test results with unknown statuses were incorrectly marked as `skipped` instead of `passed` by default. Now status matching is case-insensitive for better compatibility with different test frameworks.
12
+
1
13
  # qase-javascript-commons@2.4.6
2
14
 
3
15
  ## What's new
@@ -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
@@ -99,5 +110,7 @@ function mapOriginalStatus(originalStatus) {
99
110
  'timedOut': test_execution_1.TestStatusEnum.failed,
100
111
  'interrupted': test_execution_1.TestStatusEnum.failed,
101
112
  };
102
- return statusMap[originalStatus] || test_execution_1.TestStatusEnum.skipped;
113
+ // Convert to lowercase for case-insensitive matching
114
+ const normalizedStatus = originalStatus.toLowerCase();
115
+ return statusMap[normalizedStatus] || test_execution_1.TestStatusEnum.skipped;
103
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qase-javascript-commons",
3
- "version": "2.4.6",
3
+ "version": "2.4.8",
4
4
  "description": "Qase JS Reporters",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",