@cucumber/cucumber 12.8.1 → 12.8.3
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TestStepResult } from '@cucumber/messages';
|
|
2
|
-
export declare function formatError(error: Error, filterStackTraces: boolean): Pick<TestStepResult, 'message' | 'exception'>;
|
|
2
|
+
export declare function formatError(error: Error | string, filterStackTraces: boolean): Pick<TestStepResult, 'message' | 'exception'>;
|
|
@@ -8,7 +8,18 @@ const assertion_error_formatter_1 = require("assertion-error-formatter");
|
|
|
8
8
|
const error_stack_parser_1 = __importDefault(require("error-stack-parser"));
|
|
9
9
|
const filter_stack_trace_1 = require("../filter_stack_trace");
|
|
10
10
|
function formatError(error, filterStackTraces) {
|
|
11
|
-
|
|
11
|
+
if (typeof error === 'string') {
|
|
12
|
+
const stackTrace = `Error: ${error}`;
|
|
13
|
+
return {
|
|
14
|
+
message: stackTrace,
|
|
15
|
+
exception: {
|
|
16
|
+
type: 'Error',
|
|
17
|
+
message: error,
|
|
18
|
+
stackTrace,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
let processedStackTrace = error.stack;
|
|
12
23
|
try {
|
|
13
24
|
const parsedStack = error_stack_parser_1.default.parse(error);
|
|
14
25
|
const filteredStack = filterStackTraces
|
|
@@ -19,19 +30,21 @@ function formatError(error, filterStackTraces) {
|
|
|
19
30
|
catch {
|
|
20
31
|
// if we weren't able to parse and process, we'll settle for the original
|
|
21
32
|
}
|
|
22
|
-
const
|
|
33
|
+
const stackTrace = (0, assertion_error_formatter_1.format)(error, {
|
|
23
34
|
colorFns: {
|
|
24
35
|
errorStack: (stack) => {
|
|
25
36
|
return processedStackTrace ? `\n${processedStackTrace}` : stack;
|
|
26
37
|
},
|
|
27
38
|
},
|
|
28
39
|
});
|
|
40
|
+
const type = error.constructor.name;
|
|
41
|
+
const message = typeof error === 'string' ? error : error.message;
|
|
29
42
|
return {
|
|
30
|
-
message,
|
|
43
|
+
message: stackTrace,
|
|
31
44
|
exception: {
|
|
32
|
-
type
|
|
33
|
-
message
|
|
34
|
-
stackTrace
|
|
45
|
+
type,
|
|
46
|
+
message,
|
|
47
|
+
stackTrace,
|
|
35
48
|
},
|
|
36
49
|
};
|
|
37
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format_error.js","sourceRoot":"","sources":["../../src/runtime/format_error.ts"],"names":[],"mappings":";;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"format_error.js","sourceRoot":"","sources":["../../src/runtime/format_error.ts"],"names":[],"mappings":";;;;;AAKA,kCA0CC;AA9CD,yEAAkD;AAClD,4EAAiD;AACjD,8DAAwD;AAExD,SAAgB,WAAW,CACzB,KAAqB,EACrB,iBAA0B;IAE1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,UAAU,GAAG,UAAU,KAAK,EAAE,CAAA;QACpC,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,KAAK;gBACd,UAAU;aACX;SACF,CAAA;IACH,CAAC;IACD,IAAI,mBAAmB,GAAW,KAAK,CAAC,KAAK,CAAA;IAC7C,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,4BAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACjD,MAAM,aAAa,GAAG,iBAAiB;YACrC,CAAC,CAAC,IAAA,qCAAgB,EAAC,WAAW,CAAC;YAC/B,CAAC,CAAC,WAAW,CAAA;QACf,mBAAmB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,yEAAyE;IAC3E,CAAC;IACD,MAAM,UAAU,GAAG,IAAA,kCAAM,EAAC,KAAK,EAAE;QAC/B,QAAQ,EAAE;YACR,UAAU,EAAE,CAAC,KAAa,EAAE,EAAE;gBAC5B,OAAO,mBAAmB,CAAC,CAAC,CAAC,KAAK,mBAAmB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;YACjE,CAAC;SACF;KACF,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAA;IACnC,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAA;IACjE,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,SAAS,EAAE;YACT,IAAI;YACJ,OAAO;YACP,UAAU;SACX;KACF,CAAA;AACH,CAAC","sourcesContent":["import { TestStepResult } from '@cucumber/messages'\nimport { format } from 'assertion-error-formatter'\nimport errorStackParser from 'error-stack-parser'\nimport { filterStackTrace } from '../filter_stack_trace'\n\nexport function formatError(\n error: Error | string,\n filterStackTraces: boolean\n): Pick<TestStepResult, 'message' | 'exception'> {\n if (typeof error === 'string') {\n const stackTrace = `Error: ${error}`\n return {\n message: stackTrace,\n exception: {\n type: 'Error',\n message: error,\n stackTrace,\n },\n }\n }\n let processedStackTrace: string = error.stack\n try {\n const parsedStack = errorStackParser.parse(error)\n const filteredStack = filterStackTraces\n ? filterStackTrace(parsedStack)\n : parsedStack\n processedStackTrace = filteredStack.map((f) => f.source).join('\\n')\n } catch {\n // if we weren't able to parse and process, we'll settle for the original\n }\n const stackTrace = format(error, {\n colorFns: {\n errorStack: (stack: string) => {\n return processedStackTrace ? `\\n${processedStackTrace}` : stack\n },\n },\n })\n const type = error.constructor.name\n const message = typeof error === 'string' ? error : error.message\n return {\n message: stackTrace,\n exception: {\n type,\n message,\n stackTrace,\n },\n }\n}\n"]}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "12.8.
|
|
1
|
+
export declare const version = "12.8.3";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '12.8.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '12.8.3'\n"]}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"gherkin",
|
|
9
9
|
"tests"
|
|
10
10
|
],
|
|
11
|
-
"version": "12.8.
|
|
11
|
+
"version": "12.8.3",
|
|
12
12
|
"funding": "https://opencollective.com/cucumber",
|
|
13
13
|
"homepage": "https://github.com/cucumber/cucumber-js",
|
|
14
14
|
"author": "Julien Biezemans <jb@jbpros.com>",
|
|
@@ -224,10 +224,10 @@
|
|
|
224
224
|
"@cucumber/gherkin": "38.0.0",
|
|
225
225
|
"@cucumber/gherkin-streams": "6.0.0",
|
|
226
226
|
"@cucumber/gherkin-utils": "11.0.0",
|
|
227
|
-
"@cucumber/html-formatter": "23.
|
|
227
|
+
"@cucumber/html-formatter": "23.1.0",
|
|
228
228
|
"@cucumber/junit-xml-formatter": "0.13.3",
|
|
229
229
|
"@cucumber/message-streams": "4.1.1",
|
|
230
|
-
"@cucumber/messages": "32.
|
|
230
|
+
"@cucumber/messages": "32.3.1",
|
|
231
231
|
"@cucumber/pretty-formatter": "1.0.1",
|
|
232
232
|
"@cucumber/tag-expressions": "9.1.0",
|
|
233
233
|
"assertion-error-formatter": "^3.0.0",
|
|
@@ -265,13 +265,13 @@
|
|
|
265
265
|
"@eslint/compat": "^2.0.0",
|
|
266
266
|
"@eslint/eslintrc": "^3.3.1",
|
|
267
267
|
"@eslint/js": "^9.29.0",
|
|
268
|
-
"@microsoft/api-extractor": "7.58.
|
|
268
|
+
"@microsoft/api-extractor": "7.58.5",
|
|
269
269
|
"@sinonjs/fake-timers": "15.3.2",
|
|
270
270
|
"@types/chai": "4.3.20",
|
|
271
271
|
"@types/debug": "4.1.13",
|
|
272
272
|
"@types/dirty-chai": "2.0.5",
|
|
273
273
|
"@types/express": "5.0.6",
|
|
274
|
-
"@types/fs-extra": "
|
|
274
|
+
"@types/fs-extra": "11.0.4",
|
|
275
275
|
"@types/has-ansi": "5.0.2",
|
|
276
276
|
"@types/lodash.merge": "4.6.9",
|
|
277
277
|
"@types/lodash.mergewith": "4.6.9",
|
|
@@ -298,7 +298,7 @@
|
|
|
298
298
|
"eslint-plugin-n": "^17.20.0",
|
|
299
299
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
300
300
|
"express": "^5.0.0",
|
|
301
|
-
"fs-extra": "
|
|
301
|
+
"fs-extra": "11.3.4",
|
|
302
302
|
"genversion": "3.2.0",
|
|
303
303
|
"mocha": "^11.0.1",
|
|
304
304
|
"mustache": "4.2.0",
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
"prettier": "^3.5.3",
|
|
307
307
|
"reindent-template-literals": "1.1.0",
|
|
308
308
|
"shx": "0.4.0",
|
|
309
|
-
"sinon": "21.
|
|
309
|
+
"sinon": "21.1.2",
|
|
310
310
|
"sinon-chai": "3.7.0",
|
|
311
311
|
"stream-to-string": "1.2.1",
|
|
312
312
|
"tmp": "0.2.5",
|