@cucumber/cucumber 9.6.0 → 10.0.1

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.
Files changed (194) hide show
  1. package/README.md +2 -2
  2. package/lib/api/console_logger.d.ts +1 -1
  3. package/lib/api/console_logger.js +5 -2
  4. package/lib/api/console_logger.js.map +1 -1
  5. package/lib/api/convert_configuration.d.ts +1 -1
  6. package/lib/api/convert_configuration.js +2 -2
  7. package/lib/api/convert_configuration.js.map +1 -1
  8. package/lib/api/formatters.d.ts +2 -2
  9. package/lib/api/formatters.js +6 -6
  10. package/lib/api/formatters.js.map +1 -1
  11. package/lib/api/gherkin.d.ts +1 -1
  12. package/lib/api/gherkin.js +1 -1
  13. package/lib/api/gherkin.js.map +1 -1
  14. package/lib/api/load_configuration.js +1 -2
  15. package/lib/api/load_configuration.js.map +1 -1
  16. package/lib/api/load_sources.js +1 -1
  17. package/lib/api/load_sources.js.map +1 -1
  18. package/lib/api/load_support.d.ts +1 -1
  19. package/lib/api/load_support.js.map +1 -1
  20. package/lib/api/paths.d.ts +1 -1
  21. package/lib/api/paths.js +18 -17
  22. package/lib/api/paths.js.map +1 -1
  23. package/lib/api/plugins.d.ts +1 -1
  24. package/lib/api/plugins.js.map +1 -1
  25. package/lib/api/run_cucumber.js +2 -2
  26. package/lib/api/run_cucumber.js.map +1 -1
  27. package/lib/api/runtime.d.ts +3 -3
  28. package/lib/api/runtime.js.map +1 -1
  29. package/lib/api/support.js +2 -4
  30. package/lib/api/support.js.map +1 -1
  31. package/lib/api/test_helpers.js +8 -8
  32. package/lib/api/test_helpers.js.map +1 -1
  33. package/lib/api/types.d.ts +1 -1
  34. package/lib/api/types.js.map +1 -1
  35. package/lib/cli/helpers.d.ts +4 -4
  36. package/lib/cli/helpers.js +5 -5
  37. package/lib/cli/helpers.js.map +1 -1
  38. package/lib/cli/index.js +6 -1
  39. package/lib/cli/index.js.map +1 -1
  40. package/lib/cli/run.js +1 -1
  41. package/lib/cli/run.js.map +1 -1
  42. package/lib/cli/validate_node_engine_version.js +4 -4
  43. package/lib/cli/validate_node_engine_version.js.map +1 -1
  44. package/lib/configuration/from_file.d.ts +1 -1
  45. package/lib/configuration/from_file.js +41 -21
  46. package/lib/configuration/from_file.js.map +1 -1
  47. package/lib/configuration/locate_file.js +2 -2
  48. package/lib/configuration/locate_file.js.map +1 -1
  49. package/lib/configuration/merge_configurations.js.map +1 -1
  50. package/lib/configuration/validate_configuration.d.ts +1 -1
  51. package/lib/configuration/validate_configuration.js +3 -0
  52. package/lib/configuration/validate_configuration.js.map +1 -1
  53. package/lib/filter_stack_trace.js +4 -4
  54. package/lib/filter_stack_trace.js.map +1 -1
  55. package/lib/formatter/builder.d.ts +5 -5
  56. package/lib/formatter/builder.js +11 -24
  57. package/lib/formatter/builder.js.map +1 -1
  58. package/lib/formatter/get_color_fns.d.ts +1 -1
  59. package/lib/formatter/get_color_fns.js.map +1 -1
  60. package/lib/formatter/helpers/event_data_collector.d.ts +1 -1
  61. package/lib/formatter/helpers/event_data_collector.js +5 -5
  62. package/lib/formatter/helpers/event_data_collector.js.map +1 -1
  63. package/lib/formatter/helpers/issue_helpers.js.map +1 -1
  64. package/lib/formatter/helpers/location_helpers.js +2 -2
  65. package/lib/formatter/helpers/location_helpers.js.map +1 -1
  66. package/lib/formatter/helpers/pickle_parser.js.map +1 -1
  67. package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
  68. package/lib/formatter/helpers/summary_helpers.d.ts +1 -1
  69. package/lib/formatter/helpers/summary_helpers.js +1 -1
  70. package/lib/formatter/helpers/summary_helpers.js.map +1 -1
  71. package/lib/formatter/helpers/test_case_attempt_formatter.d.ts +1 -1
  72. package/lib/formatter/helpers/test_case_attempt_formatter.js +1 -1
  73. package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
  74. package/lib/formatter/helpers/test_case_attempt_parser.d.ts +1 -1
  75. package/lib/formatter/helpers/test_case_attempt_parser.js +3 -3
  76. package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
  77. package/lib/formatter/helpers/usage_helpers/index.js +1 -1
  78. package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
  79. package/lib/formatter/html_formatter.js +6 -5
  80. package/lib/formatter/html_formatter.js.map +1 -1
  81. package/lib/formatter/index.d.ts +3 -3
  82. package/lib/formatter/index.js +10 -0
  83. package/lib/formatter/index.js.map +1 -1
  84. package/lib/formatter/json_formatter.d.ts +1 -1
  85. package/lib/formatter/json_formatter.js +10 -8
  86. package/lib/formatter/json_formatter.js.map +1 -1
  87. package/lib/formatter/junit_formatter.js +11 -12
  88. package/lib/formatter/junit_formatter.js.map +1 -1
  89. package/lib/formatter/message_formatter.js +1 -1
  90. package/lib/formatter/message_formatter.js.map +1 -1
  91. package/lib/formatter/progress_bar_formatter.d.ts +1 -1
  92. package/lib/formatter/progress_bar_formatter.js +8 -4
  93. package/lib/formatter/progress_bar_formatter.js.map +1 -1
  94. package/lib/formatter/progress_formatter.d.ts +1 -1
  95. package/lib/formatter/progress_formatter.js +3 -3
  96. package/lib/formatter/progress_formatter.js.map +1 -1
  97. package/lib/formatter/rerun_formatter.js +5 -4
  98. package/lib/formatter/rerun_formatter.js.map +1 -1
  99. package/lib/formatter/snippets_formatter.js +4 -4
  100. package/lib/formatter/snippets_formatter.js.map +1 -1
  101. package/lib/formatter/step_definition_snippet_builder/index.d.ts +2 -2
  102. package/lib/formatter/step_definition_snippet_builder/index.js +3 -1
  103. package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
  104. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +1 -0
  105. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
  106. package/lib/formatter/summary_formatter.d.ts +1 -1
  107. package/lib/formatter/summary_formatter.js +4 -4
  108. package/lib/formatter/summary_formatter.js.map +1 -1
  109. package/lib/formatter/usage_formatter.js +4 -4
  110. package/lib/formatter/usage_formatter.js.map +1 -1
  111. package/lib/formatter/usage_json_formatter.js +2 -2
  112. package/lib/formatter/usage_json_formatter.js.map +1 -1
  113. package/lib/index.d.ts +1 -1
  114. package/lib/index.js +6 -6
  115. package/lib/index.js.map +1 -1
  116. package/lib/models/data_table.js +1 -0
  117. package/lib/models/data_table.js.map +1 -1
  118. package/lib/models/definition.d.ts +1 -1
  119. package/lib/models/definition.js +6 -0
  120. package/lib/models/definition.js.map +1 -1
  121. package/lib/models/step_definition.d.ts +1 -1
  122. package/lib/models/step_definition.js +5 -2
  123. package/lib/models/step_definition.js.map +1 -1
  124. package/lib/models/test_case_hook_definition.d.ts +1 -1
  125. package/lib/models/test_case_hook_definition.js +3 -0
  126. package/lib/models/test_case_hook_definition.js.map +1 -1
  127. package/lib/models/test_step_hook_definition.d.ts +1 -1
  128. package/lib/models/test_step_hook_definition.js +2 -0
  129. package/lib/models/test_step_hook_definition.js.map +1 -1
  130. package/lib/pickle_filter.js +11 -5
  131. package/lib/pickle_filter.js.map +1 -1
  132. package/lib/plugin/plugin_manager.d.ts +1 -1
  133. package/lib/plugin/plugin_manager.js +3 -2
  134. package/lib/plugin/plugin_manager.js.map +1 -1
  135. package/lib/plugin/types.d.ts +1 -1
  136. package/lib/plugin/types.js.map +1 -1
  137. package/lib/publish/http_stream.d.ts +2 -2
  138. package/lib/publish/http_stream.js +14 -9
  139. package/lib/publish/http_stream.js.map +1 -1
  140. package/lib/publish/publish_plugin.js +3 -3
  141. package/lib/publish/publish_plugin.js.map +1 -1
  142. package/lib/runtime/assemble_test_cases.d.ts +1 -1
  143. package/lib/runtime/assemble_test_cases.js.map +1 -1
  144. package/lib/runtime/attachment_manager/index.d.ts +1 -1
  145. package/lib/runtime/attachment_manager/index.js +1 -0
  146. package/lib/runtime/attachment_manager/index.js.map +1 -1
  147. package/lib/runtime/format_error.js +1 -1
  148. package/lib/runtime/format_error.js.map +1 -1
  149. package/lib/runtime/helpers.d.ts +1 -1
  150. package/lib/runtime/helpers.js +2 -2
  151. package/lib/runtime/helpers.js.map +1 -1
  152. package/lib/runtime/index.d.ts +1 -1
  153. package/lib/runtime/index.js +9 -0
  154. package/lib/runtime/index.js.map +1 -1
  155. package/lib/runtime/parallel/coordinator.d.ts +4 -4
  156. package/lib/runtime/parallel/coordinator.js +24 -5
  157. package/lib/runtime/parallel/coordinator.js.map +1 -1
  158. package/lib/runtime/parallel/run_worker.js +1 -1
  159. package/lib/runtime/parallel/run_worker.js.map +1 -1
  160. package/lib/runtime/parallel/worker.js +14 -6
  161. package/lib/runtime/parallel/worker.js.map +1 -1
  162. package/lib/runtime/run_test_run_hooks.js +1 -1
  163. package/lib/runtime/run_test_run_hooks.js.map +1 -1
  164. package/lib/runtime/step_runner.js +2 -2
  165. package/lib/runtime/step_runner.js.map +1 -1
  166. package/lib/runtime/stopwatch.js +2 -0
  167. package/lib/runtime/stopwatch.js.map +1 -1
  168. package/lib/runtime/test_case_runner.d.ts +1 -1
  169. package/lib/runtime/test_case_runner.js +19 -3
  170. package/lib/runtime/test_case_runner.js.map +1 -1
  171. package/lib/step_arguments.js +2 -2
  172. package/lib/step_arguments.js.map +1 -1
  173. package/lib/support_code_library_builder/get_definition_line_and_uri.js +2 -2
  174. package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -1
  175. package/lib/support_code_library_builder/index.d.ts +1 -1
  176. package/lib/support_code_library_builder/index.js +24 -8
  177. package/lib/support_code_library_builder/index.js.map +1 -1
  178. package/lib/support_code_library_builder/sourced_parameter_type_registry.js +1 -4
  179. package/lib/support_code_library_builder/sourced_parameter_type_registry.js.map +1 -1
  180. package/lib/support_code_library_builder/world.js +3 -0
  181. package/lib/support_code_library_builder/world.js.map +1 -1
  182. package/lib/time.d.ts +1 -1
  183. package/lib/time.js +2 -2
  184. package/lib/time.js.map +1 -1
  185. package/lib/user_code_runner.js +3 -3
  186. package/lib/user_code_runner.js.map +1 -1
  187. package/lib/version.d.ts +1 -1
  188. package/lib/version.js +1 -1
  189. package/lib/version.js.map +1 -1
  190. package/package.json +16 -14
  191. package/lib/formatter/fixtures/typescript.d.ts +0 -2
  192. package/lib/formatter/fixtures/typescript.js +0 -6
  193. package/lib/formatter/fixtures/typescript.js.map +0 -1
  194. package/lib/importer.js +0 -13
@@ -3,10 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SourcedParameterTypeRegistry = void 0;
4
4
  const cucumber_expressions_1 = require("@cucumber/cucumber-expressions");
5
5
  class SourcedParameterTypeRegistry extends cucumber_expressions_1.ParameterTypeRegistry {
6
- constructor() {
7
- super(...arguments);
8
- this.parameterTypeToSource = new WeakMap();
9
- }
6
+ parameterTypeToSource = new WeakMap();
10
7
  defineSourcedParameterType(parameterType, source) {
11
8
  this.defineParameterType(parameterType);
12
9
  this.parameterTypeToSource.set(parameterType, source);
@@ -1 +1 @@
1
- {"version":3,"file":"sourced_parameter_type_registry.js","sourceRoot":"","sources":["../../src/support_code_library_builder/sourced_parameter_type_registry.ts"],"names":[],"mappings":";;;AAAA,yEAGuC;AAGvC,MAAa,4BAA6B,SAAQ,4CAAqB;IAAvE;;QACU,0BAAqB,GAC3B,IAAI,OAAO,EAAE,CAAA;IAajB,CAAC;IAXC,0BAA0B,CACxB,aAAqC,EACrC,MAAmB;QAEnB,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IACvD,CAAC;IAED,YAAY,CAAC,aAAqC;QAChD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACtD,CAAC;CACF;AAfD,oEAeC","sourcesContent":["import {\n ParameterType,\n ParameterTypeRegistry,\n} from '@cucumber/cucumber-expressions'\nimport { ILineAndUri } from '../types'\n\nexport class SourcedParameterTypeRegistry extends ParameterTypeRegistry {\n private parameterTypeToSource: WeakMap<ParameterType<unknown>, ILineAndUri> =\n new WeakMap()\n\n defineSourcedParameterType(\n parameterType: ParameterType<unknown>,\n source: ILineAndUri\n ) {\n this.defineParameterType(parameterType)\n this.parameterTypeToSource.set(parameterType, source)\n }\n\n lookupSource(parameterType: ParameterType<unknown>) {\n return this.parameterTypeToSource.get(parameterType)\n }\n}\n"]}
1
+ {"version":3,"file":"sourced_parameter_type_registry.js","sourceRoot":"","sources":["../../src/support_code_library_builder/sourced_parameter_type_registry.ts"],"names":[],"mappings":";;;AAAA,yEAGuC;AAGvC,MAAa,4BAA6B,SAAQ,4CAAqB;IAC7D,qBAAqB,GAC3B,IAAI,OAAO,EAAE,CAAA;IAEf,0BAA0B,CACxB,aAAqC,EACrC,MAAmB;QAEnB,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAA;QACvC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IACvD,CAAC;IAED,YAAY,CAAC,aAAqC;QAChD,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;IACtD,CAAC;CACF;AAfD,oEAeC","sourcesContent":["import {\n ParameterType,\n ParameterTypeRegistry,\n} from '@cucumber/cucumber-expressions'\nimport { ILineAndUri } from '../types'\n\nexport class SourcedParameterTypeRegistry extends ParameterTypeRegistry {\n private parameterTypeToSource: WeakMap<ParameterType<unknown>, ILineAndUri> =\n new WeakMap()\n\n defineSourcedParameterType(\n parameterType: ParameterType<unknown>,\n source: ILineAndUri\n ) {\n this.defineParameterType(parameterType)\n this.parameterTypeToSource.set(parameterType, source)\n }\n\n lookupSource(parameterType: ParameterType<unknown>) {\n return this.parameterTypeToSource.get(parameterType)\n }\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class World {
4
+ attach;
5
+ log;
6
+ parameters;
4
7
  constructor({ attach, log, parameters }) {
5
8
  this.attach = attach;
6
9
  this.log = log;
@@ -1 +1 @@
1
- {"version":3,"file":"world.js","sourceRoot":"","sources":["../../src/support_code_library_builder/world.ts"],"names":[],"mappings":";;AAgBA,MAAqB,KAAK;IAOxB,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAiC;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAZD,wBAYC","sourcesContent":["import { ICreateAttachment, ICreateLog } from '../runtime/attachment_manager'\n\nexport interface IWorldOptions<ParametersType = any> {\n attach: ICreateAttachment\n log: ICreateLog\n parameters: ParametersType\n}\n\nexport interface IWorld<ParametersType = any> {\n readonly attach: ICreateAttachment\n readonly log: ICreateLog\n readonly parameters: ParametersType\n\n [key: string]: any\n}\n\nexport default class World<ParametersType = any>\n implements IWorld<ParametersType>\n{\n public readonly attach: ICreateAttachment\n public readonly log: ICreateLog\n public readonly parameters: ParametersType\n\n constructor({ attach, log, parameters }: IWorldOptions<ParametersType>) {\n this.attach = attach\n this.log = log\n this.parameters = parameters\n }\n}\n"]}
1
+ {"version":3,"file":"world.js","sourceRoot":"","sources":["../../src/support_code_library_builder/world.ts"],"names":[],"mappings":";;AAgBA,MAAqB,KAAK;IAGR,MAAM,CAAmB;IACzB,GAAG,CAAY;IACf,UAAU,CAAgB;IAE1C,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAiC;QACpE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAZD,wBAYC","sourcesContent":["import { ICreateAttachment, ICreateLog } from '../runtime/attachment_manager'\n\nexport interface IWorldOptions<ParametersType = any> {\n attach: ICreateAttachment\n log: ICreateLog\n parameters: ParametersType\n}\n\nexport interface IWorld<ParametersType = any> {\n readonly attach: ICreateAttachment\n readonly log: ICreateLog\n readonly parameters: ParametersType\n\n [key: string]: any\n}\n\nexport default class World<ParametersType = any>\n implements IWorld<ParametersType>\n{\n public readonly attach: ICreateAttachment\n public readonly log: ICreateLog\n public readonly parameters: ParametersType\n\n constructor({ attach, log, parameters }: IWorldOptions<ParametersType>) {\n this.attach = attach\n this.log = log\n this.parameters = parameters\n }\n}\n"]}
package/lib/time.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import { performance } from 'perf_hooks';
3
+ import { performance } from 'node:perf_hooks';
4
4
  import * as messages from '@cucumber/messages';
5
5
  interface ProtectedTimingBuiltins {
6
6
  clearImmediate: typeof clearImmediate;
package/lib/time.js CHANGED
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.wrapPromiseWithTimeout = exports.durationBetweenTimestamps = void 0;
27
- const perf_hooks_1 = require("perf_hooks");
27
+ const node_perf_hooks_1 = require("node:perf_hooks");
28
28
  const messages = __importStar(require("@cucumber/messages"));
29
29
  const methods = {
30
30
  clearInterval: clearInterval.bind(global),
@@ -32,7 +32,7 @@ const methods = {
32
32
  Date,
33
33
  setInterval: setInterval.bind(global),
34
34
  setTimeout: setTimeout.bind(global),
35
- performance: perf_hooks_1.performance,
35
+ performance: node_perf_hooks_1.performance,
36
36
  };
37
37
  if (typeof setImmediate !== 'undefined') {
38
38
  methods.setImmediate = setImmediate.bind(global);
package/lib/time.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6DAA8C;AAa9C,MAAM,OAAO,GAAqC;IAChD,aAAa,EAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;IACzC,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;IACvC,IAAI;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AA;AACH,CAAC;AAjBD,wDAiBC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial<ProtectedTimingBuiltins> = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout<T>(\n promise: Promise<T>,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise<T> {\n let timeoutId: ReturnType<typeof setTimeout>\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise<T>((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]}
1
+ {"version":3,"file":"time.js","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,6DAA8C;AAa9C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OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAChE,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAChC,CAAA;AACH,CAAC;AAjBD,wDAiBC;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import { performance } from 'node:perf_hooks'\nimport * as messages from '@cucumber/messages'\n\ninterface ProtectedTimingBuiltins {\n clearImmediate: typeof clearImmediate\n clearInterval: typeof clearInterval\n clearTimeout: typeof clearTimeout\n Date: typeof Date\n setImmediate: typeof setImmediate\n setInterval: typeof setInterval\n setTimeout: typeof setTimeout\n performance: typeof performance\n}\n\nconst methods: Partial<ProtectedTimingBuiltins> = {\n clearInterval: clearInterval.bind(global),\n clearTimeout: clearTimeout.bind(global),\n Date,\n setInterval: setInterval.bind(global),\n setTimeout: setTimeout.bind(global),\n performance,\n}\n\nif (typeof setImmediate !== 'undefined') {\n methods.setImmediate = setImmediate.bind(global)\n methods.clearImmediate = clearImmediate.bind(global)\n}\n\nexport function durationBetweenTimestamps(\n startedTimestamp: messages.Timestamp,\n finishedTimestamp: messages.Timestamp\n): messages.Duration {\n const durationMillis =\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(\n finishedTimestamp\n ) -\n messages.TimeConversion.timestampToMillisecondsSinceEpoch(startedTimestamp)\n return messages.TimeConversion.millisecondsToDuration(durationMillis)\n}\n\nexport async function wrapPromiseWithTimeout<T>(\n promise: Promise<T>,\n timeoutInMilliseconds: number,\n timeoutMessage: string = ''\n): Promise<T> {\n let timeoutId: ReturnType<typeof setTimeout>\n if (timeoutMessage === '') {\n timeoutMessage = `Action did not complete within ${timeoutInMilliseconds} milliseconds`\n }\n const timeoutPromise = new Promise<T>((resolve, reject) => {\n timeoutId = methods.setTimeout(() => {\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n return await Promise.race([promise, timeoutPromise]).finally(() =>\n methods.clearTimeout(timeoutId)\n )\n}\n\nexport default methods\n"]}
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_util_1 = __importDefault(require("node:util"));
6
7
  const time_1 = require("./time");
7
8
  const uncaught_exception_manager_1 = __importDefault(require("./uncaught_exception_manager"));
8
- const util_1 = __importDefault(require("util"));
9
9
  const value_checker_1 = require("./value_checker");
10
10
  const UserCodeRunner = {
11
11
  async run({ argsArray, thisArg, fn, timeoutInMilliseconds, }) {
@@ -24,7 +24,7 @@ const UserCodeRunner = {
24
24
  fnReturn = fn.apply(thisArg, argsArray);
25
25
  }
26
26
  catch (e) {
27
- const error = e instanceof Error ? e : util_1.default.format(e);
27
+ const error = e instanceof Error ? e : node_util_1.default.format(e);
28
28
  return { error };
29
29
  }
30
30
  const racingPromises = [];
@@ -68,7 +68,7 @@ const UserCodeRunner = {
68
68
  error = e;
69
69
  }
70
70
  else if ((0, value_checker_1.doesHaveValue)(e)) {
71
- error = util_1.default.format(e);
71
+ error = node_util_1.default.format(e);
72
72
  }
73
73
  else {
74
74
  error = new Error('Promise rejected without a reason');
@@ -1 +1 @@
1
- {"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,iCAA+C;AAC/C,8FAAmE;AACnE,gDAAuB;AACvB,mDAA+C;AAc/C,MAAM,cAAc,GAAG;IACrB,KAAK,CAAC,GAAG,CAAC,EACR,SAAS,EACT,OAAO,EACP,EAAE,EACF,qBAAqB,GACT;QACZ,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtD,SAAS,CAAC,IAAI,CAAC,CAAC,KAAY,EAAE,MAAoB,EAAE,EAAE;gBACpD,IAAI,IAAA,6BAAa,EAAC,KAAK,CAAC,EAAE;oBACxB,MAAM,CAAC,KAAK,CAAC,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QACF,cAAc,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;QAE7C,IAAI,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/C,IAAI,qBAAqB,IAAI,CAAC,EAAE;YAC9B,MAAM,cAAc,GAClB,iCAAiC;gBACjC,CAAC,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,kBAAkB,CAAC;gBACjE,WAAW,qBAAqB,CAAC,QAAQ,EAAE,eAAe,CAAA;YAC5D,YAAY,GAAG,IAAA,6BAAsB,EACnC,YAAY,EACZ,qBAAqB,EACrB,cAAc,CACf,CAAA;SACF;QAED,IAAI,KAAK,EAAE,MAAM,CAAA;QACjB,IAAI;YACF,MAAM,GAAG,MAAM,YAAY,CAAA;SAC5B;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,KAAK,GAAG,CAAC,CAAA;aACV;iBAAM,IAAI,IAAA,6BAAa,EAAC,CAAC,CAAC,EAAE;gBAC3B,KAAK,GAAG,cAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;aACvB;iBAAM;gBACL,KAAK,GAAG,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;aACvD;SACF;QAED,oCAAwB,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA;QAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport util from 'util'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise<IRunResponse> {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]}
1
+ {"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAC5B,iCAA+C;AAC/C,8FAA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M,EAAE,CAAA;IAC1B,CAAC;CACF,CAAA;AAED,kBAAe,cAAc,CAAA","sourcesContent":["import util from 'node:util'\nimport { wrapPromiseWithTimeout } from './time'\nimport UncaughtExceptionManager from './uncaught_exception_manager'\nimport { doesHaveValue } from './value_checker'\n\nexport interface IRunRequest {\n argsArray: any[]\n thisArg: any\n fn: Function\n timeoutInMilliseconds: number\n}\n\nexport interface IRunResponse {\n error?: any\n result?: any\n}\n\nconst UserCodeRunner = {\n async run({\n argsArray,\n thisArg,\n fn,\n timeoutInMilliseconds,\n }: IRunRequest): Promise<IRunResponse> {\n const callbackPromise = new Promise((resolve, reject) => {\n argsArray.push((error: Error, result: IRunResponse) => {\n if (doesHaveValue(error)) {\n reject(error)\n } else {\n resolve(result)\n }\n })\n })\n\n let fnReturn\n try {\n fnReturn = fn.apply(thisArg, argsArray)\n } catch (e) {\n const error = e instanceof Error ? e : util.format(e)\n return { error }\n }\n\n const racingPromises = []\n const callbackInterface = fn.length === argsArray.length\n const promiseInterface =\n doesHaveValue(fnReturn) && typeof fnReturn.then === 'function'\n\n if (callbackInterface && promiseInterface) {\n return {\n error: new Error(\n 'function uses multiple asynchronous interfaces: callback and promise\\n' +\n 'to use the callback interface: do not return a promise\\n' +\n 'to use the promise interface: remove the last argument to the function'\n ),\n }\n } else if (callbackInterface) {\n racingPromises.push(callbackPromise)\n } else if (promiseInterface) {\n racingPromises.push(fnReturn)\n } else {\n return { result: fnReturn }\n }\n\n let exceptionHandler\n const uncaughtExceptionPromise = new Promise((resolve, reject) => {\n exceptionHandler = reject\n UncaughtExceptionManager.registerHandler(exceptionHandler)\n })\n racingPromises.push(uncaughtExceptionPromise)\n\n let finalPromise = Promise.race(racingPromises)\n if (timeoutInMilliseconds >= 0) {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n finalPromise = wrapPromiseWithTimeout(\n finalPromise,\n timeoutInMilliseconds,\n timeoutMessage\n )\n }\n\n let error, result\n try {\n result = await finalPromise\n } catch (e) {\n if (e instanceof Error) {\n error = e\n } else if (doesHaveValue(e)) {\n error = util.format(e)\n } else {\n error = new Error('Promise rejected without a reason')\n }\n }\n\n UncaughtExceptionManager.unregisterHandler(exceptionHandler)\n\n return { error, result }\n },\n}\n\nexport default UserCodeRunner\n"]}
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "9.6.0";
1
+ export declare const version = "10.0.1";
package/lib/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = '9.6.0';
5
+ exports.version = '10.0.1';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,OAAO,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '9.6.0'\n"]}
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 = '10.0.1'\n"]}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "gherkin",
9
9
  "tests"
10
10
  ],
11
- "version": "9.6.0",
11
+ "version": "10.0.1",
12
12
  "homepage": "https://github.com/cucumber/cucumber-js",
13
13
  "author": "Julien Biezemans <jb@jbpros.com>",
14
14
  "contributors": [
@@ -201,10 +201,10 @@
201
201
  },
202
202
  "types": "./lib/index.d.ts",
203
203
  "engines": {
204
- "node": "14 || 16 || >=18"
204
+ "node": "18 || >=20"
205
205
  },
206
206
  "enginesTested": {
207
- "node": "14 || 16 || 18 || 19"
207
+ "node": "18 || 20"
208
208
  },
209
209
  "dependencies": {
210
210
  "@cucumber/ci-environment": "9.2.0",
@@ -224,7 +224,7 @@
224
224
  "debug": "^4.3.4",
225
225
  "error-stack-parser": "^2.1.4",
226
226
  "figures": "^3.2.0",
227
- "glob": "^7.1.6",
227
+ "glob": "^10.3.10",
228
228
  "has-ansi": "^4.0.1",
229
229
  "indent-string": "^4.0.0",
230
230
  "is-installed-globally": "^0.4.0",
@@ -236,6 +236,7 @@
236
236
  "mkdirp": "^2.1.5",
237
237
  "mz": "^2.7.0",
238
238
  "progress": "^2.0.3",
239
+ "read-pkg-up": "^7.0.1",
239
240
  "resolve-pkg": "^2.0.0",
240
241
  "semver": "7.5.3",
241
242
  "string-argv": "^0.3.1",
@@ -260,7 +261,7 @@
260
261
  "@types/dirty-chai": "2.0.2",
261
262
  "@types/express": "4.17.15",
262
263
  "@types/fs-extra": "9.0.13",
263
- "@types/glob": "7.2.0",
264
+ "@types/glob": "8.1.0",
264
265
  "@types/has-ansi": "5.0.0",
265
266
  "@types/lodash.merge": "4.6.7",
266
267
  "@types/lodash.mergewith": "4.6.7",
@@ -268,7 +269,7 @@
268
269
  "@types/mocha": "10.0.1",
269
270
  "@types/mustache": "4.2.2",
270
271
  "@types/mz": "2.7.4",
271
- "@types/node": "18.11.18",
272
+ "@types/node": "20.8.3",
272
273
  "@types/progress": "2.0.5",
273
274
  "@types/semver": "7.5.0",
274
275
  "@types/sinon-chai": "3.2.9",
@@ -276,26 +277,27 @@
276
277
  "@types/stream-buffers": "3.0.4",
277
278
  "@types/tmp": "0.2.3",
278
279
  "@types/verror": "1.10.6",
279
- "@typescript-eslint/eslint-plugin": "5.48.0",
280
- "@typescript-eslint/parser": "5.48.0",
280
+ "@typescript-eslint/eslint-plugin": "6.7.4",
281
+ "@typescript-eslint/parser": "6.7.4",
281
282
  "chai": "4.3.7",
282
283
  "chai-exclude": "2.1.0",
283
284
  "chai-xml": "^0.4.1",
284
285
  "coffeescript": "2.7.0",
285
286
  "dependency-lint": "7.1.0",
286
287
  "dirty-chai": "2.0.1",
287
- "eslint": "8.31.0",
288
- "eslint-config-prettier": "8.6.0",
289
- "eslint-plugin-import": "2.26.0",
288
+ "eslint": "8.51.0",
289
+ "eslint-config-prettier": "9.0.0",
290
+ "eslint-plugin-import": "2.28.1",
290
291
  "eslint-plugin-node": "11.1.0",
291
- "eslint-plugin-standard": "4.1.0",
292
+ "eslint-plugin-standard": "5.0.0",
293
+ "eslint-plugin-unicorn": "^48.0.1",
292
294
  "express": "4.18.2",
293
295
  "fs-extra": "10.1.0",
294
296
  "genversion": "3.1.1",
295
297
  "mocha": "10.2.0",
296
298
  "mustache": "4.2.0",
297
299
  "nyc": "15.1.0",
298
- "prettier": "2.8.1",
300
+ "prettier": "3.0.3",
299
301
  "reindent-template-literals": "1.1.0",
300
302
  "shx": "0.3.4",
301
303
  "sinon": "15.0.1",
@@ -310,7 +312,7 @@
310
312
  "ansi-regex": "^5.0.1"
311
313
  },
312
314
  "scripts": {
313
- "build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/importer.js lib/ && shx cp src/wrapper.mjs lib/ && shx cp src/api/wrapper.mjs lib/api/",
315
+ "build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/wrapper.mjs lib/ && shx cp src/api/wrapper.mjs lib/api/",
314
316
  "cck-test": "mocha 'compatibility/**/*_spec.ts'",
315
317
  "docs:ci": "api-extractor run --verbose",
316
318
  "docs:local": "api-extractor run --verbose --local && api-documenter markdown --input-folder ./tmp/api-extractor --output-folder ./docs/api",
@@ -1,2 +0,0 @@
1
- export default class Formatter {
2
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class Formatter {
4
- }
5
- exports.default = Formatter;
6
- //# sourceMappingURL=typescript.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/formatter/fixtures/typescript.ts"],"names":[],"mappings":";;AAAA,MAAqB,SAAS;CAAG;AAAjC,4BAAiC","sourcesContent":["export default class Formatter {}\n"]}
package/lib/importer.js DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Provides the async `import()` function to source code that needs it,
3
- * without having it transpiled down to commonjs `require()` by TypeScript.
4
- * See https://github.com/microsoft/TypeScript/issues/43329.
5
- *
6
- * @param {any} descriptor - A URL or path for the module to load
7
- * @return {Promise<any>} Promise that resolves to the loaded module
8
- */
9
- async function importer(descriptor) {
10
- return await import(descriptor)
11
- }
12
-
13
- module.exports = { importer }