@cucumber/cucumber 7.3.0 → 8.0.0-rc.2

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 (197) hide show
  1. package/README.md +11 -4
  2. package/lib/cli/argv_parser.d.ts +3 -3
  3. package/lib/cli/argv_parser.js +19 -19
  4. package/lib/cli/argv_parser.js.map +1 -1
  5. package/lib/cli/configuration_builder.d.ts +5 -46
  6. package/lib/cli/configuration_builder.js +61 -150
  7. package/lib/cli/configuration_builder.js.map +1 -1
  8. package/lib/cli/helpers.d.ts +5 -3
  9. package/lib/cli/helpers.js +42 -15
  10. package/lib/cli/helpers.js.map +1 -1
  11. package/lib/cli/i18n.js +7 -7
  12. package/lib/cli/i18n.js.map +1 -1
  13. package/lib/cli/index.d.ts +4 -23
  14. package/lib/cli/index.js +18 -193
  15. package/lib/cli/index.js.map +1 -1
  16. package/lib/cli/install_validator.js +1 -1
  17. package/lib/cli/install_validator.js.map +1 -1
  18. package/lib/cli/option_splitter.js +1 -0
  19. package/lib/cli/option_splitter.js.map +1 -1
  20. package/lib/cli/profile_loader.d.ts +3 -2
  21. package/lib/cli/profile_loader.js +20 -13
  22. package/lib/cli/profile_loader.js.map +1 -1
  23. package/lib/cli/publish_banner.js +1 -1
  24. package/lib/cli/publish_banner.js.map +1 -1
  25. package/lib/cli/run.js +3 -4
  26. package/lib/cli/run.js.map +1 -1
  27. package/lib/configuration/index.d.ts +1 -0
  28. package/lib/configuration/index.js +14 -0
  29. package/lib/configuration/index.js.map +1 -0
  30. package/lib/configuration/types.d.ts +29 -0
  31. package/lib/configuration/types.js +3 -0
  32. package/lib/configuration/types.js.map +1 -0
  33. package/lib/formatter/builder.d.ts +5 -4
  34. package/lib/formatter/builder.js +41 -55
  35. package/lib/formatter/builder.js.map +1 -1
  36. package/lib/formatter/get_color_fns.d.ts +4 -0
  37. package/lib/formatter/get_color_fns.js +11 -4
  38. package/lib/formatter/get_color_fns.js.map +1 -1
  39. package/lib/formatter/helpers/event_data_collector.d.ts +2 -1
  40. package/lib/formatter/helpers/event_data_collector.js +16 -15
  41. package/lib/formatter/helpers/event_data_collector.js.map +1 -1
  42. package/lib/formatter/helpers/formatters.d.ts +6 -0
  43. package/lib/formatter/helpers/formatters.js +41 -0
  44. package/lib/formatter/helpers/formatters.js.map +1 -0
  45. package/lib/formatter/helpers/gherkin_document_parser.js +29 -42
  46. package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -1
  47. package/lib/formatter/helpers/issue_helpers.d.ts +2 -2
  48. package/lib/formatter/helpers/issue_helpers.js +6 -7
  49. package/lib/formatter/helpers/issue_helpers.js.map +1 -1
  50. package/lib/formatter/helpers/keyword_type.js +2 -6
  51. package/lib/formatter/helpers/keyword_type.js.map +1 -1
  52. package/lib/formatter/helpers/location_helpers.js +1 -1
  53. package/lib/formatter/helpers/location_helpers.js.map +1 -1
  54. package/lib/formatter/helpers/pickle_parser.js +9 -18
  55. package/lib/formatter/helpers/pickle_parser.js.map +1 -1
  56. package/lib/formatter/helpers/step_argument_formatter.js +1 -1
  57. package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
  58. package/lib/formatter/helpers/summary_helpers.js +8 -7
  59. package/lib/formatter/helpers/summary_helpers.js.map +1 -1
  60. package/lib/formatter/helpers/test_case_attempt_formatter.js +12 -12
  61. package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
  62. package/lib/formatter/helpers/test_case_attempt_parser.js +17 -20
  63. package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
  64. package/lib/formatter/helpers/usage_helpers/index.js +26 -40
  65. package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
  66. package/lib/formatter/html_formatter.d.ts +1 -0
  67. package/lib/formatter/html_formatter.js +5 -4
  68. package/lib/formatter/html_formatter.js.map +1 -1
  69. package/lib/formatter/http_stream.js +7 -7
  70. package/lib/formatter/http_stream.js.map +1 -1
  71. package/lib/formatter/index.d.ts +1 -0
  72. package/lib/formatter/index.js.map +1 -1
  73. package/lib/formatter/json_formatter.d.ts +1 -0
  74. package/lib/formatter/json_formatter.js +25 -20
  75. package/lib/formatter/json_formatter.js.map +1 -1
  76. package/lib/formatter/message_formatter.d.ts +1 -0
  77. package/lib/formatter/message_formatter.js +1 -0
  78. package/lib/formatter/message_formatter.js.map +1 -1
  79. package/lib/formatter/progress_bar_formatter.d.ts +1 -0
  80. package/lib/formatter/progress_bar_formatter.js +17 -16
  81. package/lib/formatter/progress_bar_formatter.js.map +1 -1
  82. package/lib/formatter/progress_formatter.d.ts +1 -0
  83. package/lib/formatter/progress_formatter.js +3 -2
  84. package/lib/formatter/progress_formatter.js.map +1 -1
  85. package/lib/formatter/publish.d.ts +1 -0
  86. package/lib/formatter/publish.js +5 -0
  87. package/lib/formatter/publish.js.map +1 -0
  88. package/lib/formatter/rerun_formatter.d.ts +1 -0
  89. package/lib/formatter/rerun_formatter.js +15 -11
  90. package/lib/formatter/rerun_formatter.js.map +1 -1
  91. package/lib/formatter/snippets_formatter.d.ts +1 -0
  92. package/lib/formatter/snippets_formatter.js +3 -2
  93. package/lib/formatter/snippets_formatter.js.map +1 -1
  94. package/lib/formatter/step_definition_snippet_builder/index.js +2 -2
  95. package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
  96. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js +3 -0
  97. package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
  98. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.d.ts +1 -1
  99. package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -1
  100. package/lib/formatter/summary_formatter.d.ts +1 -0
  101. package/lib/formatter/summary_formatter.js +10 -10
  102. package/lib/formatter/summary_formatter.js.map +1 -1
  103. package/lib/formatter/usage_formatter.d.ts +1 -0
  104. package/lib/formatter/usage_formatter.js +9 -9
  105. package/lib/formatter/usage_formatter.js.map +1 -1
  106. package/lib/formatter/usage_json_formatter.d.ts +1 -0
  107. package/lib/formatter/usage_json_formatter.js +3 -2
  108. package/lib/formatter/usage_json_formatter.js.map +1 -1
  109. package/lib/importer.js +13 -0
  110. package/lib/index.d.ts +2 -0
  111. package/lib/index.js +6 -1
  112. package/lib/index.js.map +1 -1
  113. package/lib/models/data_table.js +9 -7
  114. package/lib/models/data_table.js.map +1 -1
  115. package/lib/models/step_definition.js +4 -5
  116. package/lib/models/step_definition.js.map +1 -1
  117. package/lib/pickle_filter.js +13 -13
  118. package/lib/pickle_filter.js.map +1 -1
  119. package/lib/run/formatters.d.ts +14 -0
  120. package/lib/run/formatters.js +76 -0
  121. package/lib/run/formatters.js.map +1 -0
  122. package/lib/run/index.d.ts +2 -0
  123. package/lib/run/index.js +15 -0
  124. package/lib/run/index.js.map +1 -0
  125. package/lib/run/paths.d.ts +6 -0
  126. package/lib/run/paths.js +83 -0
  127. package/lib/run/paths.js.map +1 -0
  128. package/lib/run/runCucumber.d.ts +3 -0
  129. package/lib/run/runCucumber.js +88 -0
  130. package/lib/run/runCucumber.js.map +1 -0
  131. package/lib/run/runtime.d.ts +19 -0
  132. package/lib/run/runtime.js +58 -0
  133. package/lib/run/runtime.js.map +1 -0
  134. package/lib/run/support.d.ts +8 -0
  135. package/lib/run/support.js +26 -0
  136. package/lib/run/support.js.map +1 -0
  137. package/lib/run/types.d.ts +12 -0
  138. package/lib/run/types.js +3 -0
  139. package/lib/run/types.js.map +1 -0
  140. package/lib/runtime/assemble_test_cases.js +3 -3
  141. package/lib/runtime/assemble_test_cases.js.map +1 -1
  142. package/lib/runtime/attachment_manager/index.js +4 -4
  143. package/lib/runtime/attachment_manager/index.js.map +1 -1
  144. package/lib/runtime/helpers.d.ts +1 -0
  145. package/lib/runtime/helpers.js +42 -4
  146. package/lib/runtime/helpers.js.map +1 -1
  147. package/lib/runtime/index.d.ts +5 -3
  148. package/lib/runtime/index.js +22 -46
  149. package/lib/runtime/index.js.map +1 -1
  150. package/lib/runtime/parallel/coordinator.d.ts +6 -5
  151. package/lib/runtime/parallel/coordinator.js +19 -22
  152. package/lib/runtime/parallel/coordinator.js.map +1 -1
  153. package/lib/runtime/parallel/run_worker.js +1 -1
  154. package/lib/runtime/parallel/run_worker.js.map +1 -1
  155. package/lib/runtime/parallel/worker.js +21 -13
  156. package/lib/runtime/parallel/worker.js.map +1 -1
  157. package/lib/runtime/step_runner.js +5 -7
  158. package/lib/runtime/step_runner.js.map +1 -1
  159. package/lib/runtime/stopwatch.js +4 -4
  160. package/lib/runtime/stopwatch.js.map +1 -1
  161. package/lib/runtime/test_case_runner.d.ts +3 -3
  162. package/lib/runtime/test_case_runner.js +19 -28
  163. package/lib/runtime/test_case_runner.js.map +1 -1
  164. package/lib/stack_trace_filter.js +6 -7
  165. package/lib/stack_trace_filter.js.map +1 -1
  166. package/lib/step_arguments.js +2 -2
  167. package/lib/step_arguments.js.map +1 -1
  168. package/lib/support_code_library_builder/{build_helpers.d.ts → build_parameter_type.d.ts} +0 -2
  169. package/lib/support_code_library_builder/build_parameter_type.js +13 -0
  170. package/lib/support_code_library_builder/build_parameter_type.js.map +1 -0
  171. package/lib/support_code_library_builder/get_definition_line_and_uri.d.ts +3 -0
  172. package/lib/support_code_library_builder/get_definition_line_and_uri.js +30 -0
  173. package/lib/support_code_library_builder/get_definition_line_and_uri.js.map +1 -0
  174. package/lib/support_code_library_builder/index.js +18 -31
  175. package/lib/support_code_library_builder/index.js.map +1 -1
  176. package/lib/support_code_library_builder/types.d.ts +2 -1
  177. package/lib/support_code_library_builder/types.js.map +1 -1
  178. package/lib/support_code_library_builder/validate_arguments.js +14 -19
  179. package/lib/support_code_library_builder/validate_arguments.js.map +1 -1
  180. package/lib/time.d.ts +1 -0
  181. package/lib/time.js +17 -2
  182. package/lib/time.js.map +1 -1
  183. package/lib/user_code_runner.js +10 -17
  184. package/lib/user_code_runner.js.map +1 -1
  185. package/lib/value_checker.d.ts +2 -2
  186. package/lib/value_checker.js.map +1 -1
  187. package/lib/version.d.ts +1 -0
  188. package/lib/version.js +6 -0
  189. package/lib/version.js.map +1 -0
  190. package/lib/wrapper.mjs +38 -0
  191. package/package.json +77 -67
  192. package/CHANGELOG.md +0 -1908
  193. package/lib/support_code_library_builder/build_helpers.js +0 -41
  194. package/lib/support_code_library_builder/build_helpers.js.map +0 -1
  195. package/lib/support_code_library_builder/finalize_helpers.d.ts +0 -10
  196. package/lib/support_code_library_builder/finalize_helpers.js +0 -26
  197. package/lib/support_code_library_builder/finalize_helpers.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"user_code_runner.js","sourceRoot":"","sources":["../src/user_code_runner.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAC/B,kDAAyB;AACzB,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,6BAAa,CAAC,KAAK,CAAC,EAAE;oBACxB,MAAM,CAAC,KAAK,CAAC,CAAA;iBACd;qBAAM;oBACL,OAAO,CAAC,MAAM,CAAC,CAAA;iBAChB;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,IAAI,QAAQ,CAAA;QACZ,IAAI;YACF,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;YACrD,OAAO,EAAE,KAAK,EAAE,CAAA;SACjB;QAED,MAAM,cAAc,GAAG,EAAE,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C,cAAc,CAAC,CAAC,CAAA;gBACnC,CAAC,EAAE,qBAAqB,CAAC,CAAA;YAC3B,CAAC,CAAC,CAAA;YACF,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;SACpC;QAED,IAAI,KAAK,EAAE,MAAM,CAAA;QACjB,IAAI;YACF,MAAM,GAAG,MAAM,kBAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;SAC7C;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,YAAY,KAAK,EAAE;gBACtB,KAAK,GAAG,CAAC,CAAA;aACV;iBAAM,IAAI,6BAAa,CAAC,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,cAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QAC5B,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 bluebird from 'bluebird'\nimport Time 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 timeoutId\n if (timeoutInMilliseconds >= 0) {\n const timeoutPromise = new Promise((resolve, reject) => {\n timeoutId = Time.setTimeout(() => {\n const timeoutMessage =\n 'function timed out, ensure the ' +\n (callbackInterface ? 'callback is executed' : 'promise resolves') +\n ` within ${timeoutInMilliseconds.toString()} milliseconds`\n reject(new Error(timeoutMessage))\n }, timeoutInMilliseconds)\n })\n racingPromises.push(timeoutPromise)\n }\n\n let error, result\n try {\n result = await bluebird.race(racingPromises)\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 Time.clearTimeout(timeoutId)\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,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,GAC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ception_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,3 +1,3 @@
1
- export declare function doesHaveValue(value: any): boolean;
2
- export declare function doesNotHaveValue(value: any): boolean;
1
+ export declare function doesHaveValue<T>(value: T): boolean;
2
+ export declare function doesNotHaveValue<T>(value: T): boolean;
3
3
  export declare function valueOrDefault<T>(value: T, defaultValue: T): T;
@@ -1 +1 @@
1
- {"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB,CAAC,KAAU;IACzC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AALD,wCAKC","sourcesContent":["export function doesHaveValue(value: any): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue(value: any): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault<T>(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]}
1
+ {"version":3,"file":"value_checker.js","sourceRoot":"","sources":["../src/value_checker.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAI,KAAQ;IACvC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAFD,sCAEC;AAED,SAAgB,gBAAgB,CAAI,KAAQ;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAA;AAC9C,CAAC;AAFD,4CAEC;AAED,SAAgB,cAAc,CAAI,KAAQ,EAAE,YAAe;IACzD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AALD,wCAKC","sourcesContent":["export function doesHaveValue<T>(value: T): boolean {\n return !doesNotHaveValue(value)\n}\n\nexport function doesNotHaveValue<T>(value: T): boolean {\n return value === null || value === undefined\n}\n\nexport function valueOrDefault<T>(value: T, defaultValue: T): T {\n if (doesHaveValue(value)) {\n return value\n }\n return defaultValue\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const version = "8.0.0-rc.2";
package/lib/version.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = void 0;
4
+ // generated by genversion
5
+ exports.version = '8.0.0-rc.2';
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AACb,QAAA,OAAO,GAAG,YAAY,CAAA","sourcesContent":["// generated by genversion\nexport const version = '8.0.0-rc.2'\n"]}
@@ -0,0 +1,38 @@
1
+ import cucumber from './index.js'
2
+
3
+ export const Cli = cucumber.Cli
4
+ export const parseGherkinMessageStream = cucumber.parseGherkinMessageStream
5
+ export const PickleFilter = cucumber.PickleFilter
6
+ export const Runtime = cucumber.Runtime
7
+ export const supportCodeLibraryBuilder = cucumber.supportCodeLibraryBuilder
8
+ export const Status = cucumber.Status
9
+ export const DataTable = cucumber.DataTable
10
+
11
+ export const Formatter = cucumber.Formatter
12
+ export const FormatterBuilder = cucumber.FormatterBuilder
13
+ export const JsonFormatter = cucumber.JsonFormatter
14
+ export const ProgressFormatter = cucumber.ProgressFormatter
15
+ export const RerunFormatter = cucumber.RerunFormatter
16
+ export const SnippetsFormatter = cucumber.SnippetsFormatter
17
+ export const SummaryFormatter = cucumber.SummaryFormatter
18
+ export const UsageFormatter = cucumber.UsageFormatter
19
+ export const UsageJsonFormatter = cucumber.UsageJsonFormatter
20
+ export const formatterHelpers = cucumber.formatterHelpers
21
+
22
+ export const After = cucumber.After
23
+ export const AfterAll = cucumber.AfterAll
24
+ export const AfterStep = cucumber.AfterStep
25
+ export const Before = cucumber.Before
26
+ export const BeforeAll = cucumber.BeforeAll
27
+ export const BeforeStep = cucumber.BeforeStep
28
+ export const defineParameterType = cucumber.defineParameterType
29
+ export const defineStep = cucumber.defineStep
30
+ export const Given = cucumber.Given
31
+ export const setDefaultTimeout = cucumber.setDefaultTimeout
32
+ export const setDefinitionFunctionWrapper = cucumber.setDefinitionFunctionWrapper
33
+ export const setWorldConstructor = cucumber.setWorldConstructor
34
+ export const Then = cucumber.Then
35
+ export const When = cucumber.When
36
+
37
+ export const World = cucumber.World
38
+
package/package.json CHANGED
@@ -8,11 +8,12 @@
8
8
  "gherkin",
9
9
  "tests"
10
10
  ],
11
- "version": "7.3.0",
11
+ "version": "8.0.0-rc.2",
12
12
  "homepage": "https://github.com/cucumber/cucumber-js",
13
13
  "author": "Julien Biezemans <jb@jbpros.com>",
14
14
  "contributors": [
15
15
  "Aaron Garvey",
16
+ "abelalmeida <abelalmeida@u.boisestate.edu>",
16
17
  "Adam Ark <Adam-ARK@users.noreply.github.com>",
17
18
  "Ádám Gólya <adam.golya@lab.coop>",
18
19
  "ahulab <alexbaluha@gmail.com>",
@@ -23,6 +24,7 @@
23
24
  "Artur Neumann <artur@jankaritech.com>",
24
25
  "Artur Pomadowski <artur.pomadowski@gmail.com>",
25
26
  "Aslak Hellesøy <aslak.hellesoy@gmail.com>",
27
+ "Aurélien Reeves <aurelien.reeves@smartbear.com>",
26
28
  "basemmerink <bas.emmerink@gmail.com>",
27
29
  "Ben Van Treese <vantreeseba@gmail.com>",
28
30
  "Benjamín Eidelman <beneidel+gh@gmail.com>",
@@ -65,6 +67,7 @@
65
67
  "Jayson Smith <github@nes.33mail.com>",
66
68
  "Jesse Harlin <harlinjesse@gmail.com>",
67
69
  "João Guilherme Farias Duda <jgfd@cin.ufpe.br>",
70
+ "Joaquín Sorianello <joac@users.noreply.github.com>",
68
71
  "Joey Jan <OverFlow636@users.noreply.github.com>",
69
72
  "John Krull <astrom.flux@gmail.com>",
70
73
  "John McLaughlin <john.mjhm@gmail.com>",
@@ -92,9 +95,11 @@
92
95
  "Leonardo <mondloslp@gmail.com>",
93
96
  "lopesc <lopesc@users.noreply.github.com>",
94
97
  "Lucas Cimon <lucas.cimon@gmail.com>",
98
+ "Ludek",
95
99
  "Lukas Degener <l.degener@tarent.de>",
96
100
  "Łukasz Gandecki <lgandecki@css.edu>",
97
101
  "M.P. Korstanje <mpkorstanje@users.noreply.github.com>",
102
+ "mannyluvstacos <mannyis@typingona.computer>",
98
103
  "Marat Dyatko <vectart@gmail.com>",
99
104
  "Marc Burton <marc.burton@first-utility.com>",
100
105
  "Marcel Hoyer <mhoyer@pixelplastic.de>",
@@ -138,6 +143,7 @@
138
143
  "temyers <temyers@users.noreply.github.com>",
139
144
  "Tim Perry <tim.perry@softwire.com>",
140
145
  "Tom V <tom@toc.com>",
146
+ "Tomer Ben-Rachel <tomerpacific@gmail.com>",
141
147
  "Tristan Dunn <tristanzdunn@gmail.com>",
142
148
  "unknown <jharlin@NormanDev2.telogical.com>",
143
149
  "Valerio Innocenti Sedili <valerio.innocenti.ext@yoox.com>",
@@ -163,117 +169,121 @@
163
169
  "lib": "./lib"
164
170
  },
165
171
  "main": "./lib/index.js",
172
+ "exports": {
173
+ ".": {
174
+ "import": "./lib/wrapper.mjs",
175
+ "require": "./lib/index.js"
176
+ },
177
+ "./lib/*": {
178
+ "require": "./lib/*.js"
179
+ },
180
+ "./package.json": "./package.json"
181
+ },
166
182
  "types": "./lib/index.d.ts",
167
183
  "engines": {
168
- "node": ">=10"
184
+ "node": ">=12"
169
185
  },
170
186
  "dependencies": {
171
- "@cucumber/create-meta": "^5.0.0",
172
- "@cucumber/cucumber-expressions": "^12.1.1",
173
- "@cucumber/gherkin": "^19.0.3",
174
- "@cucumber/gherkin-streams": "^2.0.2",
175
- "@cucumber/html-formatter": "^15.0.2",
176
- "@cucumber/messages": "^16.0.1",
177
- "@cucumber/tag-expressions": "^3.0.1",
187
+ "@cspotcode/source-map-support": "^0.7.0",
188
+ "@cucumber/ci-environment": "8.0.1",
189
+ "@cucumber/cucumber-expressions": "14.0.0",
190
+ "@cucumber/gherkin": "22.0.0",
191
+ "@cucumber/gherkin-streams": "4.0.0",
192
+ "@cucumber/html-formatter": "17.0.0",
193
+ "@cucumber/messages": "17.1.1",
194
+ "@cucumber/tag-expressions": "4.1.0",
178
195
  "assertion-error-formatter": "^3.0.0",
179
- "bluebird": "^3.7.2",
180
196
  "capital-case": "^1.0.4",
181
- "cli-table3": "^0.6.0",
182
- "colors": "^1.4.0",
183
- "commander": "^7.0.0",
184
- "create-require": "^1.1.1",
197
+ "cli-table3": "0.6.1",
198
+ "colors": "1.4.0",
199
+ "commander": "^8.0.0",
185
200
  "duration": "^0.2.2",
186
201
  "durations": "^3.4.2",
187
202
  "figures": "^3.2.0",
188
203
  "glob": "^7.1.6",
189
204
  "indent-string": "^4.0.0",
190
- "is-generator": "^1.0.3",
191
205
  "is-stream": "^2.0.0",
192
206
  "knuth-shuffle-seeded": "^1.0.6",
193
- "lodash": "^4.17.21",
194
207
  "mz": "^2.7.0",
195
208
  "progress": "^2.0.3",
196
209
  "resolve": "^1.19.0",
197
210
  "resolve-pkg": "^2.0.0",
198
211
  "stack-chain": "^2.0.0",
199
- "stacktrace-js": "^2.0.2",
200
212
  "string-argv": "^0.3.1",
201
213
  "tmp": "^0.2.1",
202
214
  "util-arity": "^1.1.0",
203
215
  "verror": "^1.10.0"
204
216
  },
205
217
  "devDependencies": {
206
- "@cucumber/compatibility-kit": "7.0.0",
207
- "@cucumber/message-streams": "2.0.0",
208
- "@cucumber/query": "10.0.0",
209
- "@sinonjs/fake-timers": "7.1.2",
210
- "@types/bluebird": "3.5.35",
211
- "@types/chai": "4.2.18",
218
+ "@cucumber/compatibility-kit": "9.1.2",
219
+ "@cucumber/message-streams": "3.0.0",
220
+ "@cucumber/query": "11.0.0",
221
+ "@sinonjs/fake-timers": "8.1.0",
222
+ "@types/chai": "4.3.0",
212
223
  "@types/dirty-chai": "2.0.2",
213
- "@types/express": "4.17.12",
214
- "@types/fs-extra": "9.0.11",
215
- "@types/glob": "7.1.3",
216
- "@types/lodash": "4.14.170",
217
- "@types/mocha": "8.2.2",
218
- "@types/mustache": "4.1.1",
219
- "@types/mz": "2.7.3",
220
- "@types/node": "14.17.1",
221
- "@types/progress": "2.0.3",
222
- "@types/resolve": "1.20.0",
223
- "@types/semver": "7.3.6",
224
- "@types/sinon-chai": "3.2.5",
225
- "@types/sinonjs__fake-timers": "6.0.2",
226
- "@types/stream-buffers": "3.0.3",
227
- "@types/tmp": "0.2.0",
228
- "@types/verror": "1.10.4",
229
- "@typescript-eslint/eslint-plugin": "4.26.0",
230
- "@typescript-eslint/parser": "4.26.0",
224
+ "@types/express": "4.17.13",
225
+ "@types/fs-extra": "9.0.13",
226
+ "@types/glob": "7.2.0",
227
+ "@types/mocha": "9.0.0",
228
+ "@types/mustache": "4.1.2",
229
+ "@types/mz": "2.7.4",
230
+ "@types/node": "16.11.17",
231
+ "@types/progress": "2.0.5",
232
+ "@types/resolve": "1.20.1",
233
+ "@types/semver": "7.3.9",
234
+ "@types/sinon-chai": "3.2.8",
235
+ "@types/sinonjs__fake-timers": "8.1.1",
236
+ "@types/stream-buffers": "3.0.4",
237
+ "@types/tmp": "0.2.3",
238
+ "@types/verror": "1.10.5",
239
+ "@typescript-eslint/eslint-plugin": "5.6.0",
240
+ "@typescript-eslint/parser": "5.6.0",
231
241
  "chai": "4.3.4",
232
- "chai-exclude": "2.0.3",
233
- "coffeescript": "2.5.1",
234
- "dependency-lint": "6.0.0",
242
+ "chai-exclude": "2.1.0",
243
+ "coffeescript": "2.6.1",
244
+ "dependency-lint": "7.1.0",
235
245
  "dirty-chai": "2.0.1",
236
- "eslint": "7.27.0",
246
+ "eslint": "8.4.1",
237
247
  "eslint-config-prettier": "8.3.0",
238
- "eslint-config-standard-with-typescript": "20.0.0",
239
- "eslint-plugin-import": "2.23.4",
248
+ "eslint-plugin-import": "2.25.3",
240
249
  "eslint-plugin-node": "11.1.0",
241
- "eslint-plugin-prettier": "3.4.0",
242
- "eslint-plugin-promise": "5.1.0",
250
+ "eslint-plugin-prettier": "4.0.0",
243
251
  "eslint-plugin-standard": "4.1.0",
244
- "express": "4.17.1",
245
- "fs-extra": "9.1.0",
246
- "mocha": "8.4.0",
252
+ "express": "4.17.2",
253
+ "fs-extra": "10.0.0",
254
+ "genversion": "3.0.2",
255
+ "mocha": "9.1.3",
247
256
  "mustache": "4.2.0",
248
257
  "nyc": "15.1.0",
249
- "prettier": "2.3.0",
258
+ "prettier": "2.5.1",
259
+ "reindent-template-literals": "1.1.0",
250
260
  "semver": "7.3.5",
251
- "sinon": "11.1.1",
261
+ "shx": "0.3.3",
262
+ "sinon": "12.0.1",
252
263
  "sinon-chai": "3.7.0",
253
264
  "stream-buffers": "3.0.2",
254
265
  "stream-to-string": "1.2.0",
255
- "ts-node": "9.1.1",
256
- "tsd": "0.14.0",
257
- "typescript": "4.3.2"
266
+ "ts-node": "10.4.0",
267
+ "tsd": "0.19.1",
268
+ "typescript": "4.5.4"
258
269
  },
259
270
  "scripts": {
260
- "build-local": "tsc -p tsconfig.node.json",
271
+ "build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/importer.js lib/ && shx cp src/wrapper.mjs lib/",
261
272
  "cck-test": "mocha 'compatibility/**/*_spec.ts'",
262
273
  "feature-test": "node ./bin/cucumber-js",
263
- "html-formatter": "node ./bin/cucumber-js --profile htmlFormatter",
264
274
  "lint-autofix": "eslint --fix \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
265
275
  "lint-code": "eslint \"{compatibility,example,features,scripts,src,test}/**/*.ts\"",
266
276
  "lint-dependencies": "dependency-lint",
267
- "lint": "yarn run lint-code && yarn run lint-dependencies",
268
- "prelint-autofix": "yarn build-local",
269
- "prelint-code": "yarn build-local",
270
- "precck-test": "yarn run build-local",
271
- "prefeature-test": "yarn run build-local",
277
+ "lint": "npm run lint-code && npm run lint-dependencies",
278
+ "prelint-autofix": "npm run build-local",
279
+ "prelint-code": "npm run build-local",
280
+ "precck-test": "npm run build-local",
281
+ "prefeature-test": "npm run build-local",
272
282
  "prepublishOnly": "rm -rf lib && npm run build-local",
273
- "pretest-coverage": "yarn build-local",
274
- "pretypes-test": "yarn build-local",
283
+ "pretest-coverage": "npm run build-local",
284
+ "pretypes-test": "npm run build-local",
275
285
  "test-coverage": "nyc --silent mocha 'src/**/*_spec.ts' 'compatibility/**/*_spec.ts' && nyc --silent --no-clean node ./bin/cucumber-js && nyc report --reporter=lcov",
276
- "test": "yarn run lint && yarn run types-test && yarn run unit-test && yarn run cck-test && yarn run feature-test",
286
+ "test": "npm run lint && npm run types-test && npm run unit-test && npm run cck-test && npm run feature-test",
277
287
  "types-test": "tsd",
278
288
  "unit-test": "mocha 'src/**/*_spec.ts'",
279
289
  "update-dependencies": "npx npm-check-updates --upgrade"