@testomatio/reporter 2.3.6-beta.1-truncate-steps → 2.3.6

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.
@@ -110,6 +110,25 @@ function CodeceptReporter(config) {
110
110
  output.stepShift = 2;
111
111
  index_js_1.services.setContext(null);
112
112
  });
113
+ // mark as failed all tests inside the failed hook
114
+ event.dispatcher.on(event.hook.failed, hook => {
115
+ if (hook.name !== 'BeforeSuiteHook')
116
+ return;
117
+ const suite = hook.runnable.parent;
118
+ if (!suite)
119
+ return;
120
+ const error = hook?.ctx?.currentTest?.err;
121
+ for (const test of suite.tests) {
122
+ client.addTestRun('failed', {
123
+ ...stripExampleFromTitle(test.title),
124
+ rid: test.uid,
125
+ test_id: (0, utils_js_1.getTestomatIdFromTestTitle)(test.title),
126
+ suite_title: stripTagsFromTitle(suite.title),
127
+ error,
128
+ time: hook?.runnable?.duration,
129
+ });
130
+ }
131
+ });
113
132
  event.dispatcher.on(event.suite.before, suite => {
114
133
  data_storage_js_1.dataStorage.setContext(suite.fullTitle());
115
134
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "2.3.6-beta.1-truncate-steps",
3
+ "version": "2.3.6",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "engines": {
6
6
  "node": ">=18"
@@ -127,6 +127,28 @@ function CodeceptReporter(config) {
127
127
  });
128
128
 
129
129
 
130
+ // mark as failed all tests inside the failed hook
131
+ event.dispatcher.on(event.hook.failed, hook => {
132
+ if (hook.name !== 'BeforeSuiteHook') return;
133
+ const suite = hook.runnable.parent;
134
+
135
+ if (!suite) return;
136
+
137
+ const error = hook?.ctx?.currentTest?.err;
138
+
139
+ for (const test of suite.tests) {
140
+ client.addTestRun('failed', {
141
+ ...stripExampleFromTitle(test.title),
142
+ rid: test.uid,
143
+ test_id: getTestomatIdFromTestTitle(test.title),
144
+ suite_title: stripTagsFromTitle(suite.title),
145
+ error,
146
+ time: hook?.runnable?.duration,
147
+ });
148
+ }
149
+ });
150
+
151
+
130
152
  event.dispatcher.on(event.suite.before, suite => {
131
153
  dataStorage.setContext(suite.fullTitle());
132
154
  });