testdriverai 7.3.22 → 7.3.24

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,11 @@
1
+ ## [7.3.24](https://github.com/testdriverai/testdriverai/compare/v7.3.23...v7.3.24) (2026-02-20)
2
+
3
+
4
+
5
+ ## [7.3.23](https://github.com/testdriverai/testdriverai/compare/v7.3.22...v7.3.23) (2026-02-20)
6
+
7
+
8
+
1
9
  ## [7.3.22](https://github.com/testdriverai/testdriverai/compare/v7.3.21...v7.3.22) (2026-02-19)
2
10
 
3
11
 
@@ -49,12 +49,41 @@ function initializeSentry() {
49
49
  runner: "vitest",
50
50
  },
51
51
  },
52
- // Don't send user-cancelled errors
52
+ // Filter out events that should not be reported to Sentry
53
53
  beforeSend(event, hint) {
54
54
  const error = hint.originalException;
55
+
56
+ // Don't send user-cancelled errors
55
57
  if (error && error.message && error.message.includes("User cancelled")) {
56
58
  return null;
57
59
  }
60
+
61
+ // Don't send test failures - these are expected behavior, not bugs in the SDK
62
+ // Test failures indicate the test found a problem, which is the intended use case
63
+ if (event.exception?.values) {
64
+ for (const exception of event.exception.values) {
65
+ // Filter out TestFailure type (from Vitest test failures)
66
+ if (exception.type === "TestFailure") {
67
+ return null;
68
+ }
69
+
70
+ // Filter out common user code errors (ReferenceError, TypeError from user tests)
71
+ // Only report if the error originates from TestDriver SDK code, not user test code
72
+ const isUserCodeError = exception.stacktrace?.frames?.some(frame => {
73
+ const filename = frame.filename || frame.abs_path || "";
74
+ // Check if error is from user test files (not from SDK internals)
75
+ return filename.includes("/tests/") ||
76
+ filename.includes("/test/") ||
77
+ filename.includes(".test.") ||
78
+ filename.includes(".spec.");
79
+ });
80
+
81
+ if (isUserCodeError && (exception.type === "ReferenceError" || exception.type === "TypeError")) {
82
+ return null;
83
+ }
84
+ }
85
+ }
86
+
58
87
  return event;
59
88
  },
60
89
  });
@@ -67,22 +96,6 @@ function initializeSentry() {
67
96
  }
68
97
  }
69
98
 
70
- /**
71
- * Previously captured test failures in Sentry.
72
- * Now disabled - test failures are expected behavior, not crashes.
73
- * We only want to report actual exceptions and crashes to Sentry.
74
- *
75
- * @param {Object} _params - Test failure parameters (ignored)
76
- * @deprecated This function no longer sends data to Sentry.
77
- */
78
- // eslint-disable-next-line no-unused-vars
79
- function captureTestFailure(_params) {
80
- // Test failures are expected behavior - they indicate a test found a bug.
81
- // We should only report actual exceptions and crashes to Sentry, not every failed test.
82
- // This function is now a no-op to prevent flooding Sentry with test failures.
83
- return;
84
- }
85
-
86
99
  /**
87
100
  * Flush Sentry events before process exit
88
101
  * @param {number} [timeout=2000] - Timeout in ms
@@ -1122,16 +1135,9 @@ class TestDriverReporter {
1122
1135
  errorMessage = error.message;
1123
1136
  errorStack = error.stack;
1124
1137
 
1125
- // Report test failure to Sentry
1126
- captureTestFailure({
1127
- testName: test.name,
1128
- testFile,
1129
- errorMessage,
1130
- errorStack,
1131
- sessionId,
1132
- platform: platform || pluginState.detectedPlatform,
1133
- duration,
1134
- });
1138
+ // Note: We do NOT report test failures to Sentry.
1139
+ // Test failures are expected behavior (they indicate a test found a bug).
1140
+ // We only want actual SDK crashes and exceptions reported to Sentry.
1135
1141
  }
1136
1142
 
1137
1143
  const suiteName = test.suite?.name;
@@ -1295,11 +1301,16 @@ function calculateStatsFromModules(testModules) {
1295
1301
 
1296
1302
  for (const testModule of testModules) {
1297
1303
  for (const testCase of testModule.children.allTests()) {
1298
- totalTests++;
1299
1304
  const result = testCase.result();
1300
- if (result.state === "passed") passedTests++;
1301
- else if (result.state === "failed") failedTests++;
1302
- else if (result.state === "skipped") skippedTests++;
1305
+ if (result.state === "passed") {
1306
+ passedTests++;
1307
+ totalTests++;
1308
+ } else if (result.state === "failed") {
1309
+ failedTests++;
1310
+ totalTests++;
1311
+ } else if (result.state === "skipped") {
1312
+ skippedTests++;
1313
+ }
1303
1314
  }
1304
1315
  }
1305
1316
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "7.3.22",
3
+ "version": "7.3.24",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "sdk.js",
6
6
  "types": "sdk.d.ts",