@cucumber/cucumber 7.0.0 → 7.3.0
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 +63 -17
- package/README.md +8 -11
- package/lib/cli/argv_parser.js.map +1 -1
- package/lib/cli/configuration_builder.js +3 -3
- package/lib/cli/configuration_builder.js.map +1 -1
- package/lib/cli/helpers.js +40 -18
- package/lib/cli/helpers.js.map +1 -1
- package/lib/cli/i18n.js.map +1 -1
- package/lib/cli/index.js +40 -23
- package/lib/cli/index.js.map +1 -1
- package/lib/cli/install_validator.js.map +1 -1
- package/lib/cli/option_splitter.js.map +1 -1
- package/lib/cli/profile_loader.d.ts +1 -2
- package/lib/cli/profile_loader.js.map +1 -1
- package/lib/cli/publish_banner.js.map +1 -1
- package/lib/cli/run.js.map +1 -1
- package/lib/formatter/builder.js.map +1 -1
- package/lib/formatter/get_color_fns.d.ts +2 -2
- package/lib/formatter/get_color_fns.js +7 -8
- package/lib/formatter/get_color_fns.js.map +1 -1
- package/lib/formatter/helpers/event_data_collector.d.ts +14 -17
- package/lib/formatter/helpers/event_data_collector.js +14 -8
- package/lib/formatter/helpers/event_data_collector.js.map +1 -1
- package/lib/formatter/helpers/gherkin_document_parser.d.ts +5 -6
- package/lib/formatter/helpers/gherkin_document_parser.js +1 -4
- package/lib/formatter/helpers/gherkin_document_parser.js.map +1 -1
- package/lib/formatter/helpers/index.js.map +1 -1
- package/lib/formatter/helpers/issue_helpers.d.ts +6 -6
- package/lib/formatter/helpers/issue_helpers.js +5 -6
- package/lib/formatter/helpers/issue_helpers.js.map +1 -1
- package/lib/formatter/helpers/keyword_type.js.map +1 -1
- package/lib/formatter/helpers/location_helpers.js.map +1 -1
- package/lib/formatter/helpers/pickle_parser.d.ts +9 -10
- package/lib/formatter/helpers/pickle_parser.js.map +1 -1
- package/lib/formatter/helpers/step_argument_formatter.d.ts +2 -2
- package/lib/formatter/helpers/step_argument_formatter.js.map +1 -1
- package/lib/formatter/helpers/summary_helpers.d.ts +2 -2
- package/lib/formatter/helpers/summary_helpers.js +32 -14
- package/lib/formatter/helpers/summary_helpers.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_formatter.js +33 -14
- package/lib/formatter/helpers/test_case_attempt_formatter.js.map +1 -1
- package/lib/formatter/helpers/test_case_attempt_parser.d.ts +5 -5
- package/lib/formatter/helpers/test_case_attempt_parser.js +27 -9
- package/lib/formatter/helpers/test_case_attempt_parser.js.map +1 -1
- package/lib/formatter/helpers/usage_helpers/index.d.ts +3 -3
- package/lib/formatter/helpers/usage_helpers/index.js +30 -13
- package/lib/formatter/helpers/usage_helpers/index.js.map +1 -1
- package/lib/formatter/html_formatter.js +2 -2
- package/lib/formatter/html_formatter.js.map +1 -1
- package/lib/formatter/http_stream.d.ts +8 -9
- package/lib/formatter/http_stream.js +58 -54
- package/lib/formatter/http_stream.js.map +1 -1
- package/lib/formatter/index.js.map +1 -1
- package/lib/formatter/json_formatter.d.ts +21 -27
- package/lib/formatter/json_formatter.js +50 -23
- package/lib/formatter/json_formatter.js.map +1 -1
- package/lib/formatter/message_formatter.js +1 -1
- package/lib/formatter/message_formatter.js.map +1 -1
- package/lib/formatter/progress_bar_formatter.d.ts +6 -6
- package/lib/formatter/progress_bar_formatter.js +3 -3
- package/lib/formatter/progress_bar_formatter.js.map +1 -1
- package/lib/formatter/progress_formatter.d.ts +2 -2
- package/lib/formatter/progress_formatter.js +29 -10
- package/lib/formatter/progress_formatter.js.map +1 -1
- package/lib/formatter/rerun_formatter.js +22 -4
- package/lib/formatter/rerun_formatter.js.map +1 -1
- package/lib/formatter/snippets_formatter.js +22 -3
- package/lib/formatter/snippets_formatter.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/index.d.ts +3 -3
- package/lib/formatter/step_definition_snippet_builder/index.js +1 -1
- package/lib/formatter/step_definition_snippet_builder/index.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/javascript_snippet_syntax.js.map +1 -1
- package/lib/formatter/step_definition_snippet_builder/snippet_syntax.js.map +1 -1
- package/lib/formatter/summary_formatter.d.ts +2 -2
- package/lib/formatter/summary_formatter.js.map +1 -1
- package/lib/formatter/usage_formatter.js +22 -3
- package/lib/formatter/usage_formatter.js.map +1 -1
- package/lib/formatter/usage_json_formatter.js.map +1 -1
- package/lib/index.d.ts +14 -12
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/models/data_table.d.ts +3 -4
- package/lib/models/data_table.js.map +1 -1
- package/lib/models/definition.d.ts +2 -2
- package/lib/models/definition.js.map +1 -1
- package/lib/models/step_definition.js.map +1 -1
- package/lib/models/test_case_hook_definition.d.ts +2 -2
- package/lib/models/test_case_hook_definition.js.map +1 -1
- package/lib/models/test_run_hook_definition.js.map +1 -1
- package/lib/models/test_step_hook_definition.d.ts +2 -2
- package/lib/models/test_step_hook_definition.js.map +1 -1
- package/lib/pickle_filter.d.ts +9 -11
- package/lib/pickle_filter.js +4 -4
- package/lib/pickle_filter.js.map +1 -1
- package/lib/runtime/assemble_test_cases.d.ts +13 -0
- package/lib/runtime/assemble_test_cases.js +88 -0
- package/lib/runtime/assemble_test_cases.js.map +1 -0
- package/lib/runtime/attachment_manager/index.d.ts +6 -6
- package/lib/runtime/attachment_manager/index.js +33 -6
- package/lib/runtime/attachment_manager/index.js.map +1 -1
- package/lib/runtime/helpers.d.ts +2 -2
- package/lib/runtime/helpers.js.map +1 -1
- package/lib/runtime/index.d.ts +4 -3
- package/lib/runtime/index.js +31 -13
- package/lib/runtime/index.js.map +1 -1
- package/lib/runtime/parallel/command_types.d.ts +10 -9
- package/lib/runtime/parallel/command_types.js.map +1 -1
- package/lib/runtime/parallel/coordinator.d.ts +10 -9
- package/lib/runtime/parallel/coordinator.js +54 -43
- package/lib/runtime/parallel/coordinator.js.map +1 -1
- package/lib/runtime/parallel/run_worker.js.map +1 -1
- package/lib/runtime/parallel/worker.d.ts +2 -2
- package/lib/runtime/parallel/worker.js +8 -14
- package/lib/runtime/parallel/worker.js.map +1 -1
- package/lib/runtime/step_runner.d.ts +3 -3
- package/lib/runtime/step_runner.js +16 -12
- package/lib/runtime/step_runner.js.map +1 -1
- package/lib/runtime/stopwatch.d.ts +4 -4
- package/lib/runtime/stopwatch.js +21 -2
- package/lib/runtime/stopwatch.js.map +1 -1
- package/lib/runtime/{pickle_runner.d.ts → test_case_runner.d.ts} +16 -32
- package/lib/runtime/{pickle_runner.js → test_case_runner.js} +104 -147
- package/lib/runtime/test_case_runner.js.map +1 -0
- package/lib/stack_trace_filter.js.map +1 -1
- package/lib/step_arguments.d.ts +4 -4
- package/lib/step_arguments.js.map +1 -1
- package/lib/support_code_library_builder/build_helpers.js.map +1 -1
- package/lib/support_code_library_builder/finalize_helpers.js.map +1 -1
- package/lib/support_code_library_builder/index.d.ts +9 -7
- package/lib/support_code_library_builder/index.js +10 -10
- package/lib/support_code_library_builder/index.js.map +1 -1
- package/lib/support_code_library_builder/types.d.ts +20 -22
- package/lib/support_code_library_builder/types.js.map +1 -1
- package/lib/support_code_library_builder/validate_arguments.js.map +1 -1
- package/lib/support_code_library_builder/world.d.ts +7 -1
- package/lib/support_code_library_builder/world.js.map +1 -1
- package/lib/time.d.ts +2 -10
- package/lib/time.js +24 -48
- package/lib/time.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/uncaught_exception_manager.js +2 -12
- package/lib/uncaught_exception_manager.js.map +1 -1
- package/lib/user_code_runner.js.map +1 -1
- package/lib/value_checker.js.map +1 -1
- package/package.json +49 -46
- package/lib/runtime/pickle_runner.js.map +0 -1
- package/lib/status.d.ts +0 -3
- package/lib/status.js +0 -5
- package/lib/status.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,58 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
|
|
|
19
19
|
|
|
20
20
|
### Fixed
|
|
21
21
|
|
|
22
|
+
## [7.3.0] (2021-06-17)
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
* Experimental support for [Markdown](https://github.com/cucumber/common/blob/main/gherkin/MARKDOWN_WITH_GHERKIN.md)
|
|
27
|
+
([#1645](https://github.com/cucumber/cucumber-js/pull/1645))
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
* All `testCase` messages now emitted upfront at the start of the run (relevant for formatter authors) ([#1408](https://github.com/cucumber/cucumber-js/issues/1408)
|
|
32
|
+
[#1669](https://github.com/cucumber/cucumber-js/pull/1669))
|
|
33
|
+
* Clarify that the JSON formatter will not be removed any time soon
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
* `this` now has correct TypeScript type in support code functions ([#1667](https://github.com/cucumber/cucumber-js/issues/1667) [#1690](https://github.com/cucumber/cucumber-js/pull/1690))
|
|
38
|
+
* Progress bar formatter now reports total step count correctly ([#1579](https://github.com/cucumber/cucumber-js/issues/1579)
|
|
39
|
+
[#1669](https://github.com/cucumber/cucumber-js/pull/1669))
|
|
40
|
+
* Rerun functionality will now run nothing if the rerun file is empty from the previous run ([#1302](https://github.com/cucumber/cucumber-js/issues/1302) [#1568](https://github.com/cucumber/cucumber-js/pull/1568))
|
|
41
|
+
* All messages now emitted with project-relative `uri`s
|
|
42
|
+
([#1534](https://github.com/cucumber/cucumber-js/issues/1534)
|
|
43
|
+
[#1672](https://github.com/cucumber/cucumber-js/pull/1672))
|
|
44
|
+
* Json formatter now works with tagged examples
|
|
45
|
+
([#1621](https://github.com/cucumber/cucumber-js/issues/1621)
|
|
46
|
+
[#1651](https://github.com/cucumber/cucumber-js/pull/1651))
|
|
47
|
+
|
|
48
|
+
## [7.2.1] (2021-04-21)
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
|
|
52
|
+
* Temporarily remove ESM changes due to impact on formatters
|
|
53
|
+
|
|
54
|
+
## [7.2.0] (2021-04-20)
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
|
|
58
|
+
* Experimental support for native ES modules via the [`--esm` flag](./docs/cli.md#es-modules-experimental-nodejs-12) ([#1589](https://github.com/cucumber/cucumber-js/pull/1589))
|
|
59
|
+
|
|
60
|
+
## [7.1.0] (2021-04-06)
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
|
|
64
|
+
- Support attachments that are already base64-encoded via a prefix on the MIME type e.g. `this.attach(base64String, 'base64:image/png')` ([#1552](https://github.com/cucumber/cucumber-js/pull/1552))
|
|
65
|
+
- Support tagged rules ([cucumber#1123](https://github.com/cucumber/cucumber/issues/1123))
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
* Fix types for hook functions so they can return e.g. `'skipped'` ([#1542](https://github.com/cucumber/cucumber-js/pull/1542))
|
|
70
|
+
* Display the response of the reports server when an error is returned before failing. ([#1608](https://github.com/cucumber/cucumber-js/pull/1608))
|
|
71
|
+
* Remove unnecessary implicit dependency on `long` package ([cucumber#1313](https://github.com/cucumber/cucumber/pull/1313))
|
|
72
|
+
* Remove unnecessary transitive dependencies on `react` etc ([cucumber#1308](https://github.com/cucumber/cucumber/pull/1308))
|
|
73
|
+
|
|
22
74
|
## [7.0.0] (2020-12-21)
|
|
23
75
|
|
|
24
76
|
### Added
|
|
@@ -37,18 +89,7 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
|
|
|
37
89
|
|
|
38
90
|
## [7.0.0-rc.0] (2020-09-14)
|
|
39
91
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Migration guide
|
|
43
|
-
|
|
44
|
-
- `npm uninstall cucumber`
|
|
45
|
-
- `npm install --save-dev @cucumber/cucumber`
|
|
46
|
-
- require/import `@cucumber/cucumber` instead of `cucumber`
|
|
47
|
-
- TypeScript
|
|
48
|
-
- Replace `TableDefinition` with `DataTable`
|
|
49
|
-
- `npm uninstall @types/cucumber`
|
|
50
|
-
|
|
51
|
-
If anything is missing from the migration guide, please submit an issue.
|
|
92
|
+
See the [migration guide](./docs/migration.md) for details of how to migrate from 6.x.x.
|
|
52
93
|
|
|
53
94
|
### New Features
|
|
54
95
|
|
|
@@ -60,21 +101,22 @@ If anything is missing from the migration guide, please submit an issue.
|
|
|
60
101
|
|
|
61
102
|
### Breaking changes
|
|
62
103
|
|
|
63
|
-
* The npm module has changed name from `cucumber` to `@cucumber/cucumber`
|
|
64
|
-
* Your `require` / `import` statements must be changed from `cucumber` to `@cucumber/cucumber`
|
|
104
|
+
* The npm module has changed name from `cucumber` to `@cucumber/cucumber` - `require`/`import` statements must be changed from `cucumber` to `@cucumber/cucumber`
|
|
65
105
|
* TypeScript users must rename `TableDefinition` to `DataTable`
|
|
66
106
|
* Drop support for Node.js 8, add support for Node.js 14
|
|
67
107
|
* Formatters
|
|
68
108
|
* Events are now based on [cucumber-messages](https://github.com/cucumber/cucumber/tree/master/messages)
|
|
69
109
|
* `event-protocol` formatter has been removed and replaced with `message`
|
|
70
|
-
* Custom formatters will need to migrate
|
|
71
|
-
* `json` formatter is deprecated and will be removed in next major release. Custom formatters should migrate to use the `message` formatter, or the [standalone JSON formatter](https://github.com/cucumber/cucumber/tree/master/json-formatter) as a stopgap.
|
|
72
110
|
* Remove long-deprecated `typeName` from options object for `defineParameterType` in favour of `name`
|
|
73
111
|
* Parallel runtime environment variables renamed for inclusivity:
|
|
74
112
|
* `CUCUMBER_TOTAL_SLAVES` is now `CUCUMBER_TOTAL_WORKERS`
|
|
75
113
|
* `CUCUMBER_SLAVE_ID` is now `CUCUMBER_WORKER_ID`
|
|
76
114
|
* Custom formatters are now loaded via the regular require paths relative to the current directory, unless it begins with a dot (e.g. `--format=./relpath/to/formatter`). Previously this was always loaded as a file relative to the current directory.
|
|
77
115
|
|
|
116
|
+
### Deprecations
|
|
117
|
+
|
|
118
|
+
* `json` formatter is deprecated and will be removed in next major release. Custom formatters should migrate to use the `message` formatter, or the [standalone JSON formatter](https://github.com/cucumber/cucumber/tree/master/json-formatter) as a stopgap.
|
|
119
|
+
|
|
78
120
|
### Bug fixes
|
|
79
121
|
|
|
80
122
|
* don't execute BeforeAll and AfterAll hooks when in dry-run
|
|
@@ -1809,7 +1851,11 @@ be used to get the name / tags of the running scenario. ([#947](https://github.c
|
|
|
1809
1851
|
|
|
1810
1852
|
|
|
1811
1853
|
<!-- Releases -->
|
|
1812
|
-
[Unreleased]: https://github.com/cucumber/cucumber-js/compare/v7.
|
|
1854
|
+
[Unreleased]: https://github.com/cucumber/cucumber-js/compare/v7.3.0...master
|
|
1855
|
+
[7.3.0]: https://github.com/cucumber/cucumber-js/compare/7.3.0-rc.0...7.0.0
|
|
1856
|
+
[7.2.1]: https://github.com/cucumber/cucumber-js/compare/7.2.1-rc.0...7.0.0
|
|
1857
|
+
[7.2.0]: https://github.com/cucumber/cucumber-js/compare/7.2.0-rc.0...7.0.0
|
|
1858
|
+
[7.1.0]: https://github.com/cucumber/cucumber-js/compare/7.1.0-rc.0...7.0.0
|
|
1813
1859
|
[7.0.0]: https://github.com/cucumber/cucumber-js/compare/7.0.0-rc.0...v7.0.0
|
|
1814
1860
|
[7.0.0-rc.0]: https://github.com/cucumber/cucumber-js/compare/v6.0.5...v7.0.0-rc.0
|
|
1815
1861
|
[6.0.5]: https://github.com/cucumber/cucumber-js/compare/v6.0.4...v6.0.5
|
package/README.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://opencollective.com/cucumber)
|
|
4
4
|
[](https://opencollective.com/cucumber)
|
|
5
|
+
[](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-js)
|
|
6
|
+
[](https://oselvar.com/github/cucumber/oselvar-github-metrics/main/cucumber/cucumber-js)
|
|
5
7
|
|
|
6
|
-
[](https://ci.appveyor.com/project/charlierudolph/cucumber-js/history)
|
|
8
|
+
[](https://github.com/cucumber/cucumber-js/actions)
|
|
8
9
|
[](https://david-dm.org/cucumber/cucumber-js)
|
|
9
10
|
[](https://coveralls.io/github/cucumber/cucumber-js?branch=master)
|
|
10
11
|
|
|
@@ -33,24 +34,20 @@ Everyone interacting in this codebase and issue tracker is expected to follow th
|
|
|
33
34
|
|
|
34
35
|
## Install
|
|
35
36
|
|
|
36
|
-
[](https://npm-stat.com/charts.html?package=cucumber&from=2015-09-01)
|
|
37
|
-
|
|
38
|
-
### Node
|
|
39
|
-
|
|
40
37
|
Cucumber.js is available as an npm module.
|
|
41
38
|
|
|
42
|
-
|
|
39
|
+
### 7.x.x and above
|
|
43
40
|
|
|
44
41
|
``` shell
|
|
45
|
-
$ npm install cucumber
|
|
42
|
+
$ npm install @cucumber/cucumber
|
|
46
43
|
```
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
If you're upgrading from 6.x.x or below, see the [migration guide](./docs/migration.md).
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
### 6.x.x and below
|
|
51
48
|
|
|
52
49
|
``` shell
|
|
53
|
-
$ npm install @
|
|
50
|
+
$ npm install cucumber@6
|
|
54
51
|
```
|
|
55
52
|
|
|
56
53
|
## Documentation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"argv_parser.js","sourceRoot":"","sources":["../../src/cli/argv_parser.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,yCAAmC;AACnC,gDAAuB;AACvB,+CAA4C;AAG5C,gGAAgG;AAChG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA,CAAC,yDAAyD;AA6C3G,MAAM,UAAU,GAAG;IACjB,OAAO,CAAI,GAAM,EAAE,IAAS;QAC1B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IAED,SAAS,CAAC,MAAc;QACtB,OAAO,UAAU,GAAW,EAAE,IAAY;YACxC,IAAI,GAAW,CAAA;YACf,IAAI;gBACF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aACtB;YAAC,OAAO,KAAK,EAAE;gBAC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;aACA,MAAM,CACL,yBAAyB,EACzB,uFAAuF,EACvF,UAAU,CAAC,SAAS,EACpB,EAAE,CACH;aACA,MAAM,CACL,2BAA2B,EAC3B,8EAA8E,EAC9E,UAAU,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAC1C,EAAE,CACH,CAAA;QAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACxB,+BAA+B;YAC/B,OAAO,CAAC,GAAG,CACT,mGAAmG,CACpG,CAAA;YACD,8BAA8B;QAChC,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACnB,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAwB,CAAA;QACpD,UAAU,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;QAExC,OAAO;YACL,OAAO;YACP,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAA;IACH,CAAC;IAED,IAAI,CAAC,QAAkB;QACrB,IAAI,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YACzC,OAAO,CAAC,IAAI,CACV,oHAAoH,CACrH,CAAA;SACF;IACH,CAAC;CACF,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import _ from 'lodash'\nimport { Command } from 'commander'\nimport path from 'path'\nimport { dialects } from '@cucumber/gherkin'\nimport { SnippetInterface } from '../formatter/step_definition_snippet_builder/snippet_syntax'\n\n// Using require instead of import so compiled typescript will have the desired folder structure\nconst { version } = require('../../package.json') // eslint-disable-line @typescript-eslint/no-var-requires\n\nexport interface IParsedArgvFormatRerunOptions {\n separator?: string\n}\n\nexport interface IParsedArgvFormatOptions {\n colorsEnabled?: boolean\n rerun?: IParsedArgvFormatRerunOptions\n snippetInterface?: SnippetInterface\n snippetSyntax?: string\n [customKey: string]: any\n}\n\nexport interface IParsedArgvOptions {\n backtrace: boolean\n dryRun: boolean\n exit: boolean\n failFast: boolean\n format: string[]\n formatOptions: IParsedArgvFormatOptions\n i18nKeywords: string\n i18nLanguages: boolean\n language: string\n name: string[]\n order: string\n parallel: number\n predictableIds: boolean\n profile: string[]\n publish: boolean\n publishQuiet: boolean\n require: string[]\n requireModule: string[]\n retry: number\n retryTagFilter: string\n strict: boolean\n tags: string\n worldParameters: object\n}\n\nexport interface IParsedArgv {\n args: string[]\n options: IParsedArgvOptions\n}\n\nconst ArgvParser = {\n collect<T>(val: T, memo: T[]): T[] {\n memo.push(val)\n return memo\n },\n\n mergeJson(option: string): (str: string, memo: object) => object {\n return function (str: string, memo: object) {\n let val: object\n try {\n val = JSON.parse(str)\n } catch (error) {\n const e: Error = error\n throw new Error(`${option} passed invalid JSON: ${e.message}: ${str}`)\n }\n if (!_.isPlainObject(val)) {\n throw new Error(`${option} must be passed JSON of an object: ${str}`)\n }\n return _.merge(memo, val)\n }\n },\n\n mergeTags(value: string, memo: string): string {\n return memo === '' ? `(${value})` : `${memo} and (${value})`\n },\n\n validateCountOption(value: string, optionName: string): number {\n const numericValue = parseInt(value)\n if (isNaN(numericValue) || numericValue < 0) {\n throw new Error(`${optionName} must be a non negative integer`)\n }\n return numericValue\n },\n\n validateLanguage(value: string): string {\n if (!_.includes(_.keys(dialects), value)) {\n throw new Error(`Unsupported ISO 639-1: ${value}`)\n }\n return value\n },\n\n validateRetryOptions(options: IParsedArgvOptions): void {\n if (options.retryTagFilter !== '' && options.retry === 0) {\n throw new Error(\n 'a positive --retry count must be specified when setting --retry-tag-filter'\n )\n }\n },\n\n parse(argv: string[]): IParsedArgv {\n const program = new Command(path.basename(argv[1]))\n\n program\n .storeOptionsAsProperties(false)\n .usage('[options] [<GLOB|DIR|FILE[:LINE]>...]')\n .version(version, '-v, --version')\n .option('-b, --backtrace', 'show full backtrace for errors')\n .option(\n '-d, --dry-run',\n 'invoke formatters without executing steps',\n false\n )\n .option(\n '--exit',\n 'force shutdown of the event loop when the test run has finished: cucumber will call process.exit',\n false\n )\n .option('--fail-fast', 'abort the run on first failure', false)\n .option(\n '-f, --format <TYPE[:PATH]>',\n 'specify the output format, optionally supply PATH to redirect formatter output (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--format-options <JSON>',\n 'provide options for formatters (repeatable)',\n ArgvParser.mergeJson('--format-options'),\n {}\n )\n .option(\n '--i18n-keywords <ISO 639-1>',\n 'list language keywords',\n ArgvParser.validateLanguage,\n ''\n )\n .option('--i18n-languages', 'list languages', false)\n .option(\n '--language <ISO 639-1>',\n 'provide the default language for feature files',\n 'en'\n )\n .option(\n '--name <REGEXP>',\n 'only execute the scenarios with name matching the expression (repeatable)',\n ArgvParser.collect,\n []\n )\n .option('--no-strict', 'succeed even if there are pending steps')\n .option(\n '--order <TYPE[:SEED]>',\n 'run scenarios in the specified order. Type should be `defined` or `random`',\n 'defined'\n )\n .option(\n '-p, --profile <NAME>',\n 'specify the profile to use (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--parallel <NUMBER_OF_WORKERS>',\n 'run in parallel with the given number of workers',\n (val) => ArgvParser.validateCountOption(val, '--parallel'),\n 0\n )\n .option(\n '--predictable-ids',\n 'Use predictable ids in messages (option ignored if using parallel)',\n false\n )\n .option(\n '--publish',\n 'Publish a report to https://reports.cucumber.io',\n false\n )\n .option(\n '--publish-quiet',\n \"Don't print information banner about publishing reports\",\n false\n )\n .option(\n '-r, --require <GLOB|DIR|FILE>',\n 'require files before executing features (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--require-module <NODE_MODULE>',\n 'require node modules before requiring files (repeatable)',\n ArgvParser.collect,\n []\n )\n .option(\n '--retry <NUMBER_OF_RETRIES>',\n 'specify the number of times to retry failing test cases (default: 0)',\n (val) => ArgvParser.validateCountOption(val, '--retry'),\n 0\n )\n .option(\n '--retryTagFilter, --retry-tag-filter <EXPRESSION>',\n `only retries the features or scenarios with tags matching the expression (repeatable).\n This option requires '--retry' to be specified.`,\n ArgvParser.mergeTags,\n ''\n )\n .option(\n '-t, --tags <EXPRESSION>',\n 'only execute the features or scenarios with tags matching the expression (repeatable)',\n ArgvParser.mergeTags,\n ''\n )\n .option(\n '--world-parameters <JSON>',\n 'provide parameters that will be passed to the world constructor (repeatable)',\n ArgvParser.mergeJson('--world-parameters'),\n {}\n )\n\n program.on('--help', () => {\n /* eslint-disable no-console */\n console.log(\n ' For more details please visit https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md\\n'\n )\n /* eslint-enable no-console */\n })\n\n program.parse(argv)\n const options = program.opts() as IParsedArgvOptions\n ArgvParser.validateRetryOptions(options)\n\n return {\n options,\n args: program.args,\n }\n },\n\n lint(fullArgv: string[]): void {\n if (fullArgv.includes('--retryTagFilter')) {\n console.warn(\n 'the argument --retryTagFilter is deprecated and will be removed in a future release; please use --retry-tag-filter'\n )\n }\n },\n}\n\nexport default ArgvParser\n"]}
|
|
@@ -144,16 +144,16 @@ class ConfigurationBuilder {
|
|
|
144
144
|
if (filename[0] === '@') {
|
|
145
145
|
const filePath = path_1.default.join(this.cwd, arg);
|
|
146
146
|
const content = await fs_1.default.readFile(filePath, 'utf8');
|
|
147
|
-
return lodash_1.default.chain(content).split('\n').map(lodash_1.default.trim).
|
|
147
|
+
return lodash_1.default.chain(content).split('\n').map(lodash_1.default.trim).value();
|
|
148
148
|
}
|
|
149
149
|
return [arg];
|
|
150
150
|
});
|
|
151
151
|
const featurePaths = lodash_1.default.flatten(nestedFeaturePaths);
|
|
152
152
|
if (featurePaths.length > 0) {
|
|
153
|
-
return featurePaths;
|
|
153
|
+
return lodash_1.default.compact(featurePaths);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
return ['features/**/*.feature'];
|
|
156
|
+
return ['features/**/*.{feature,feature.md}'];
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
exports.default = ConfigurationBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration_builder.js","sourceRoot":"","sources":["../../src/cli/configuration_builder.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,gEAG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IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,MAAM,kBAAkB,GAAG,MAAM,kBAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;gBACrE,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;gBACnC,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACvB,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;oBACzC,MAAM,OAAO,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;oBACnD,OAAO,gBAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,gBAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;iBACxD;gBACD,OAAO,CAAC,GAAG,CAAC,CAAA;YACd,CAAC,CAAC,CAAA;YACF,MAAM,YAAY,GAAG,gBAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;YAClD,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3B,OAAO,gBAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;aAC/B;SACF;QACD,OAAO,CAAC,oCAAoC,CAAC,CAAA;IAC/C,CAAC;CACF;AAhLD,uCAgLC","sourcesContent":["import _ from 'lodash'\nimport ArgvParser, {\n IParsedArgvFormatOptions,\n IParsedArgvOptions,\n} from './argv_parser'\nimport fs from 'mz/fs'\nimport path from 'path'\nimport OptionSplitter from './option_splitter'\nimport bluebird from 'bluebird'\nimport glob from 'glob'\nimport { promisify } from 'util'\nimport { IPickleFilterOptions } from '../pickle_filter'\nimport { IRuntimeOptions } from '../runtime'\nimport { valueOrDefault } from '../value_checker'\n\nexport interface IConfigurationFormat {\n outputTo: string\n type: string\n}\n\nexport interface IConfiguration {\n featureDefaultLanguage: string\n featurePaths: string[]\n formats: IConfigurationFormat[]\n formatOptions: IParsedArgvFormatOptions\n publishing: boolean\n listI18nKeywordsFor: string\n listI18nLanguages: boolean\n order: string\n parallel: number\n pickleFilterOptions: IPickleFilterOptions\n predictableIds: boolean\n profiles: string[]\n runtimeOptions: IRuntimeOptions\n shouldExitImmediately: boolean\n supportCodePaths: string[]\n supportCodeRequiredModules: string[]\n suppressPublishAdvertisement: boolean\n}\n\nexport interface INewConfigurationBuilderOptions {\n argv: string[]\n cwd: string\n}\n\nconst DEFAULT_CUCUMBER_PUBLISH_URL = 'https://messages.cucumber.io/api/reports'\n\nexport default class ConfigurationBuilder {\n static async build(\n options: INewConfigurationBuilderOptions\n ): Promise<IConfiguration> {\n const builder = new ConfigurationBuilder(options)\n return await builder.build()\n }\n\n private readonly cwd: string\n private readonly args: string[]\n private readonly options: IParsedArgvOptions\n\n constructor({ argv, cwd }: INewConfigurationBuilderOptions) {\n this.cwd = cwd\n\n ArgvParser.lint(argv)\n const parsedArgv = ArgvParser.parse(argv)\n this.args = parsedArgv.args\n this.options = parsedArgv.options\n }\n\n async build(): Promise<IConfiguration> {\n const listI18nKeywordsFor = this.options.i18nKeywords\n const listI18nLanguages = this.options.i18nLanguages\n const unexpandedFeaturePaths = await this.getUnexpandedFeaturePaths()\n let featurePaths: string[] = []\n let supportCodePaths: string[] = []\n if (listI18nKeywordsFor === '' && !listI18nLanguages) {\n featurePaths = await this.expandFeaturePaths(unexpandedFeaturePaths)\n let unexpandedSupportCodePaths = this.options.require\n if (unexpandedSupportCodePaths.length === 0) {\n unexpandedSupportCodePaths = this.getFeatureDirectoryPaths(featurePaths)\n }\n supportCodePaths = await this.expandPaths(\n unexpandedSupportCodePaths,\n '.js'\n )\n }\n return {\n featureDefaultLanguage: this.options.language,\n featurePaths,\n formats: this.getFormats(),\n formatOptions: this.options.formatOptions,\n publishing: this.isPublishing(),\n listI18nKeywordsFor,\n listI18nLanguages,\n order: this.options.order,\n parallel: this.options.parallel,\n pickleFilterOptions: {\n cwd: this.cwd,\n featurePaths: unexpandedFeaturePaths,\n names: this.options.name,\n tagExpression: this.options.tags,\n },\n predictableIds: this.options.predictableIds,\n profiles: this.options.profile,\n runtimeOptions: {\n dryRun: this.options.dryRun,\n predictableIds: this.options.predictableIds,\n failFast: this.options.failFast,\n filterStacktraces: !this.options.backtrace,\n retry: this.options.retry,\n retryTagFilter: this.options.retryTagFilter,\n strict: this.options.strict,\n worldParameters: this.options.worldParameters,\n },\n shouldExitImmediately: this.options.exit,\n supportCodePaths,\n supportCodeRequiredModules: this.options.requireModule,\n suppressPublishAdvertisement: this.isPublishAdvertisementSuppressed(),\n }\n }\n\n async expandPaths(\n unexpandedPaths: string[],\n defaultExtension: string\n ): Promise<string[]> {\n const expandedPaths = await bluebird.map(\n unexpandedPaths,\n async (unexpandedPath) => {\n const matches = await promisify(glob)(unexpandedPath, {\n absolute: true,\n cwd: this.cwd,\n })\n const expanded = await bluebird.map(matches, async (match) => {\n if (path.extname(match) === '') {\n return await promisify(glob)(`${match}/**/*${defaultExtension}`)\n }\n return [match]\n })\n return _.flatten(expanded)\n }\n )\n return _.flatten(expandedPaths).map((x) => path.normalize(x))\n }\n\n async expandFeaturePaths(featurePaths: string[]): Promise<string[]> {\n featurePaths = featurePaths.map((p) => p.replace(/(:\\d+)*$/g, '')) // Strip line numbers\n return this.expandPaths(featurePaths, '.feature')\n }\n\n getFeatureDirectoryPaths(featurePaths: string[]): string[] {\n const featureDirs = featurePaths.map((featurePath) => {\n let featureDir = path.dirname(featurePath)\n let childDir: string\n let parentDir = featureDir\n while (childDir !== parentDir) {\n childDir = parentDir\n parentDir = path.dirname(childDir)\n if (path.basename(parentDir) === 'features') {\n featureDir = parentDir\n break\n }\n }\n return path.relative(this.cwd, featureDir)\n })\n return _.uniq(featureDirs)\n }\n\n isPublishing(): boolean {\n return (\n this.options.publish ||\n this.isTruthyString(process.env.CUCUMBER_PUBLISH_ENABLED) ||\n process.env.CUCUMBER_PUBLISH_TOKEN !== undefined\n )\n }\n\n isPublishAdvertisementSuppressed(): boolean {\n return (\n this.options.publishQuiet ||\n this.isTruthyString(process.env.CUCUMBER_PUBLISH_QUIET)\n )\n }\n\n getFormats(): IConfigurationFormat[] {\n const mapping: { [key: string]: string } = { '': 'progress' }\n this.options.format.forEach((format) => {\n const [type, outputTo] = OptionSplitter.split(format)\n mapping[outputTo] = type\n })\n if (this.isPublishing()) {\n const publishUrl = valueOrDefault(\n process.env.CUCUMBER_PUBLISH_URL,\n DEFAULT_CUCUMBER_PUBLISH_URL\n )\n\n mapping[publishUrl] = 'message'\n }\n return _.map(mapping, (type, outputTo) => ({ outputTo, type }))\n }\n\n isTruthyString(s: string | undefined): boolean {\n if (s === undefined) {\n return false\n }\n return s.match(/^(false|no|0)$/i) === null\n }\n\n async getUnexpandedFeaturePaths(): Promise<string[]> {\n if (this.args.length > 0) {\n const nestedFeaturePaths = await bluebird.map(this.args, async (arg) => {\n const filename = path.basename(arg)\n if (filename[0] === '@') {\n const filePath = path.join(this.cwd, arg)\n const content = await fs.readFile(filePath, 'utf8')\n return _.chain(content).split('\\n').map(_.trim).value()\n }\n return [arg]\n })\n const featurePaths = _.flatten(nestedFeaturePaths)\n if (featurePaths.length > 0) {\n return _.compact(featurePaths)\n }\n }\n return ['features/**/*.{feature,feature.md}']\n }\n}\n"]}
|
package/lib/cli/helpers.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
@@ -8,13 +27,11 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
8
27
|
const argv_parser_1 = __importDefault(require("./argv_parser"));
|
|
9
28
|
const profile_loader_1 = __importDefault(require("./profile_loader"));
|
|
10
29
|
const knuth_shuffle_seeded_1 = __importDefault(require("knuth-shuffle-seeded"));
|
|
11
|
-
const path_1 = __importDefault(require("path"));
|
|
12
30
|
const value_checker_1 = require("../value_checker");
|
|
13
31
|
const option_splitter_1 = __importDefault(require("./option_splitter"));
|
|
14
|
-
const
|
|
32
|
+
const messages = __importStar(require("@cucumber/messages"));
|
|
15
33
|
const create_meta_1 = __importDefault(require("@cucumber/create-meta"));
|
|
16
34
|
const support_code_library_builder_1 = require("../support_code_library_builder");
|
|
17
|
-
const StepDefinitionPatternType = messages_1.messages.StepDefinition.StepDefinitionPattern.StepDefinitionPatternType;
|
|
18
35
|
async function getExpandedArgv({ argv, cwd, }) {
|
|
19
36
|
const { options } = argv_parser_1.default.parse(argv);
|
|
20
37
|
let fullArgv = argv;
|
|
@@ -39,7 +56,7 @@ async function parseGherkinMessageStream({ cwd, eventBroadcaster, eventDataColle
|
|
|
39
56
|
}
|
|
40
57
|
}
|
|
41
58
|
if (value_checker_1.doesHaveValue(envelope.parseError)) {
|
|
42
|
-
reject(new Error(`Parse error in '${
|
|
59
|
+
reject(new Error(`Parse error in '${envelope.parseError.source.uri}': ${envelope.parseError.message}`));
|
|
43
60
|
}
|
|
44
61
|
});
|
|
45
62
|
gherkinMessageStream.on('end', () => {
|
|
@@ -71,9 +88,9 @@ exports.orderPickleIds = orderPickleIds;
|
|
|
71
88
|
async function emitMetaMessage(eventBroadcaster) {
|
|
72
89
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
73
90
|
const { version } = require('../../package.json');
|
|
74
|
-
eventBroadcaster.emit('envelope',
|
|
91
|
+
eventBroadcaster.emit('envelope', {
|
|
75
92
|
meta: create_meta_1.default('cucumber-js', version, process.env),
|
|
76
|
-
})
|
|
93
|
+
});
|
|
77
94
|
}
|
|
78
95
|
exports.emitMetaMessage = emitMetaMessage;
|
|
79
96
|
function emitParameterTypes(supportCodeLibrary, eventBroadcaster, newId) {
|
|
@@ -82,7 +99,7 @@ function emitParameterTypes(supportCodeLibrary, eventBroadcaster, newId) {
|
|
|
82
99
|
if (support_code_library_builder_1.builtinParameterTypes.includes(parameterType.name)) {
|
|
83
100
|
continue;
|
|
84
101
|
}
|
|
85
|
-
|
|
102
|
+
const envelope = {
|
|
86
103
|
parameterType: {
|
|
87
104
|
id: newId(),
|
|
88
105
|
name: parameterType.name,
|
|
@@ -90,26 +107,28 @@ function emitParameterTypes(supportCodeLibrary, eventBroadcaster, newId) {
|
|
|
90
107
|
regularExpressions: parameterType.regexpStrings,
|
|
91
108
|
useForSnippets: parameterType.useForSnippets,
|
|
92
109
|
},
|
|
93
|
-
}
|
|
110
|
+
};
|
|
111
|
+
eventBroadcaster.emit('envelope', envelope);
|
|
94
112
|
}
|
|
95
113
|
}
|
|
96
114
|
function emitUndefinedParameterTypes(supportCodeLibrary, eventBroadcaster) {
|
|
97
115
|
for (const undefinedParameterType of supportCodeLibrary.undefinedParameterTypes) {
|
|
98
|
-
|
|
116
|
+
const envelope = {
|
|
99
117
|
undefinedParameterType,
|
|
100
|
-
}
|
|
118
|
+
};
|
|
119
|
+
eventBroadcaster.emit('envelope', envelope);
|
|
101
120
|
}
|
|
102
121
|
}
|
|
103
122
|
function emitStepDefinitions(supportCodeLibrary, eventBroadcaster) {
|
|
104
123
|
supportCodeLibrary.stepDefinitions.forEach((stepDefinition) => {
|
|
105
|
-
|
|
124
|
+
const envelope = {
|
|
106
125
|
stepDefinition: {
|
|
107
126
|
id: stepDefinition.id,
|
|
108
127
|
pattern: {
|
|
109
128
|
source: stepDefinition.pattern.toString(),
|
|
110
129
|
type: typeof stepDefinition.pattern === 'string'
|
|
111
|
-
? StepDefinitionPatternType.CUCUMBER_EXPRESSION
|
|
112
|
-
: StepDefinitionPatternType.REGULAR_EXPRESSION,
|
|
130
|
+
? messages.StepDefinitionPatternType.CUCUMBER_EXPRESSION
|
|
131
|
+
: messages.StepDefinitionPatternType.REGULAR_EXPRESSION,
|
|
113
132
|
},
|
|
114
133
|
sourceReference: {
|
|
115
134
|
uri: stepDefinition.uri,
|
|
@@ -118,7 +137,8 @@ function emitStepDefinitions(supportCodeLibrary, eventBroadcaster) {
|
|
|
118
137
|
},
|
|
119
138
|
},
|
|
120
139
|
},
|
|
121
|
-
}
|
|
140
|
+
};
|
|
141
|
+
eventBroadcaster.emit('envelope', envelope);
|
|
122
142
|
});
|
|
123
143
|
}
|
|
124
144
|
function emitTestCaseHooks(supportCodeLibrary, eventBroadcaster) {
|
|
@@ -126,7 +146,7 @@ function emitTestCaseHooks(supportCodeLibrary, eventBroadcaster) {
|
|
|
126
146
|
[]
|
|
127
147
|
.concat(supportCodeLibrary.beforeTestCaseHookDefinitions, supportCodeLibrary.afterTestCaseHookDefinitions)
|
|
128
148
|
.forEach((testCaseHookDefinition) => {
|
|
129
|
-
|
|
149
|
+
const envelope = {
|
|
130
150
|
hook: {
|
|
131
151
|
id: testCaseHookDefinition.id,
|
|
132
152
|
tagExpression: testCaseHookDefinition.tagExpression,
|
|
@@ -137,7 +157,8 @@ function emitTestCaseHooks(supportCodeLibrary, eventBroadcaster) {
|
|
|
137
157
|
},
|
|
138
158
|
},
|
|
139
159
|
},
|
|
140
|
-
}
|
|
160
|
+
};
|
|
161
|
+
eventBroadcaster.emit('envelope', envelope);
|
|
141
162
|
});
|
|
142
163
|
}
|
|
143
164
|
function emitTestRunHooks(supportCodeLibrary, eventBroadcaster) {
|
|
@@ -145,7 +166,7 @@ function emitTestRunHooks(supportCodeLibrary, eventBroadcaster) {
|
|
|
145
166
|
[]
|
|
146
167
|
.concat(supportCodeLibrary.beforeTestRunHookDefinitions, supportCodeLibrary.afterTestRunHookDefinitions)
|
|
147
168
|
.forEach((testRunHookDefinition) => {
|
|
148
|
-
|
|
169
|
+
const envelope = {
|
|
149
170
|
hook: {
|
|
150
171
|
id: testRunHookDefinition.id,
|
|
151
172
|
sourceReference: {
|
|
@@ -155,7 +176,8 @@ function emitTestRunHooks(supportCodeLibrary, eventBroadcaster) {
|
|
|
155
176
|
},
|
|
156
177
|
},
|
|
157
178
|
},
|
|
158
|
-
}
|
|
179
|
+
};
|
|
180
|
+
eventBroadcaster.emit('envelope', envelope);
|
|
159
181
|
});
|
|
160
182
|
}
|
|
161
183
|
function emitSupportCodeMessages({ eventBroadcaster, supportCodeLibrary, newId, }) {
|
package/lib/cli/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/cli/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,gEAAsC;AACtC,sEAA4C;AAC5C,gFAA0C;AAC1C,gDAAuB;AAIvB,oDAAgD;AAChD,wEAA8C;AAE9C,iDAA0D;AAC1D,wEAA8C;AAI9C,kFAAuE;AAEvE,MAAM,yBAAyB,GAC7B,mBAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,yBAAyB,CAAA;AAOlE,KAAK,UAAU,eAAe,CAAC,EACpC,IAAI,EACJ,GAAG,GACqB;I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gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;AACN,CAAC;AAED,SAAgB,uBAAuB,CAAC,EACtC,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,GAKN;IACC,kBAAkB,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAA;IAC/D,2BAA2B,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;IACjE,mBAAmB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;IACzD,iBAAiB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;IACvD,gBAAgB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;AACxD,CAAC;AAdD,0DAcC","sourcesContent":["import _ from 'lodash'\nimport ArgvParser from './argv_parser'\nimport ProfileLoader from './profile_loader'\nimport shuffle from 'knuth-shuffle-seeded'\nimport { EventEmitter } from 'events'\nimport PickleFilter from '../pickle_filter'\nimport { EventDataCollector } from '../formatter/helpers'\nimport { doesHaveValue } from '../value_checker'\nimport OptionSplitter from './option_splitter'\nimport { Readable } from 'stream'\nimport { IdGenerator } from '@cucumber/messages'\nimport * as messages from '@cucumber/messages'\nimport createMeta from '@cucumber/create-meta'\nimport { ISupportCodeLibrary } from '../support_code_library_builder/types'\nimport TestCaseHookDefinition from '../models/test_case_hook_definition'\nimport TestRunHookDefinition from '../models/test_run_hook_definition'\nimport { builtinParameterTypes } from '../support_code_library_builder'\n\nexport interface IGetExpandedArgvRequest {\n argv: string[]\n cwd: string\n}\n\nexport async function getExpandedArgv({\n argv,\n cwd,\n}: IGetExpandedArgvRequest): Promise<string[]> {\n const { options } = ArgvParser.parse(argv)\n let fullArgv = argv\n const profileArgv = await new ProfileLoader(cwd).getArgv(options.profile)\n if (profileArgv.length > 0) {\n fullArgv = _.concat(argv.slice(0, 2), profileArgv, argv.slice(2))\n }\n return fullArgv\n}\n\ninterface IParseGherkinMessageStreamRequest {\n cwd: string\n eventBroadcaster: EventEmitter\n eventDataCollector: EventDataCollector\n gherkinMessageStream: Readable\n order: string\n pickleFilter: PickleFilter\n}\n\nexport async function parseGherkinMessageStream({\n cwd,\n eventBroadcaster,\n eventDataCollector,\n gherkinMessageStream,\n order,\n pickleFilter,\n}: IParseGherkinMessageStreamRequest): Promise<string[]> {\n return await new Promise<string[]>((resolve, reject) => {\n const result: string[] = []\n gherkinMessageStream.on('data', (envelope: messages.Envelope) => {\n eventBroadcaster.emit('envelope', envelope)\n if (doesHaveValue(envelope.pickle)) {\n const pickle = envelope.pickle\n const pickleId = pickle.id\n const gherkinDocument = eventDataCollector.getGherkinDocument(\n pickle.uri\n )\n if (pickleFilter.matches({ gherkinDocument, pickle })) {\n result.push(pickleId)\n }\n }\n if (doesHaveValue(envelope.parseError)) {\n reject(\n new Error(\n `Parse error in '${envelope.parseError.source.uri}': ${envelope.parseError.message}`\n )\n )\n }\n })\n gherkinMessageStream.on('end', () => {\n orderPickleIds(result, order)\n resolve(result)\n })\n gherkinMessageStream.on('error', reject)\n })\n}\n\n// Orders the pickleIds in place - morphs input\nexport function orderPickleIds(pickleIds: string[], order: string): void {\n let [type, seed] = OptionSplitter.split(order)\n switch (type) {\n case 'defined':\n break\n case 'random':\n if (seed === '') {\n seed = Math.floor(Math.random() * 1000 * 1000).toString()\n console.warn(`Random order using seed: ${seed}`)\n }\n shuffle(pickleIds, seed)\n break\n default:\n throw new Error(\n 'Unrecgonized order type. Should be `defined` or `random`'\n )\n }\n}\n\nexport async function emitMetaMessage(\n eventBroadcaster: EventEmitter\n): Promise<void> {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const { version } = require('../../package.json')\n eventBroadcaster.emit('envelope', {\n meta: createMeta('cucumber-js', version, process.env),\n })\n}\n\nfunction emitParameterTypes(\n supportCodeLibrary: ISupportCodeLibrary,\n eventBroadcaster: EventEmitter,\n newId: IdGenerator.NewId\n): void {\n for (const parameterType of supportCodeLibrary.parameterTypeRegistry\n .parameterTypes) {\n if (builtinParameterTypes.includes(parameterType.name)) {\n continue\n }\n const envelope: messages.Envelope = {\n parameterType: {\n id: newId(),\n name: parameterType.name,\n preferForRegularExpressionMatch: parameterType.preferForRegexpMatch,\n regularExpressions: parameterType.regexpStrings,\n useForSnippets: parameterType.useForSnippets,\n },\n }\n eventBroadcaster.emit('envelope', envelope)\n }\n}\n\nfunction emitUndefinedParameterTypes(\n supportCodeLibrary: ISupportCodeLibrary,\n eventBroadcaster: EventEmitter\n): void {\n for (const undefinedParameterType of supportCodeLibrary.undefinedParameterTypes) {\n const envelope: messages.Envelope = {\n undefinedParameterType,\n }\n eventBroadcaster.emit('envelope', envelope)\n }\n}\n\nfunction emitStepDefinitions(\n supportCodeLibrary: ISupportCodeLibrary,\n eventBroadcaster: EventEmitter\n): void {\n supportCodeLibrary.stepDefinitions.forEach((stepDefinition) => {\n const envelope: messages.Envelope = {\n stepDefinition: {\n id: stepDefinition.id,\n pattern: {\n source: stepDefinition.pattern.toString(),\n type:\n typeof stepDefinition.pattern === 'string'\n ? messages.StepDefinitionPatternType.CUCUMBER_EXPRESSION\n : messages.StepDefinitionPatternType.REGULAR_EXPRESSION,\n },\n sourceReference: {\n uri: stepDefinition.uri,\n location: {\n line: stepDefinition.line,\n },\n },\n },\n }\n eventBroadcaster.emit('envelope', envelope)\n })\n}\n\nfunction emitTestCaseHooks(\n supportCodeLibrary: ISupportCodeLibrary,\n eventBroadcaster: EventEmitter\n): void {\n ;[]\n .concat(\n supportCodeLibrary.beforeTestCaseHookDefinitions,\n supportCodeLibrary.afterTestCaseHookDefinitions\n )\n .forEach((testCaseHookDefinition: TestCaseHookDefinition) => {\n const envelope: messages.Envelope = {\n hook: {\n id: testCaseHookDefinition.id,\n tagExpression: testCaseHookDefinition.tagExpression,\n sourceReference: {\n uri: testCaseHookDefinition.uri,\n location: {\n line: testCaseHookDefinition.line,\n },\n },\n },\n }\n eventBroadcaster.emit('envelope', envelope)\n })\n}\n\nfunction emitTestRunHooks(\n supportCodeLibrary: ISupportCodeLibrary,\n eventBroadcaster: EventEmitter\n): void {\n ;[]\n .concat(\n supportCodeLibrary.beforeTestRunHookDefinitions,\n supportCodeLibrary.afterTestRunHookDefinitions\n )\n .forEach((testRunHookDefinition: TestRunHookDefinition) => {\n const envelope: messages.Envelope = {\n hook: {\n id: testRunHookDefinition.id,\n sourceReference: {\n uri: testRunHookDefinition.uri,\n location: {\n line: testRunHookDefinition.line,\n },\n },\n },\n }\n eventBroadcaster.emit('envelope', envelope)\n })\n}\n\nexport function emitSupportCodeMessages({\n eventBroadcaster,\n supportCodeLibrary,\n newId,\n}: {\n eventBroadcaster: EventEmitter\n supportCodeLibrary: ISupportCodeLibrary\n newId: IdGenerator.NewId\n}): void {\n emitParameterTypes(supportCodeLibrary, eventBroadcaster, newId)\n emitUndefinedParameterTypes(supportCodeLibrary, eventBroadcaster)\n emitStepDefinitions(supportCodeLibrary, eventBroadcaster)\n emitTestCaseHooks(supportCodeLibrary, eventBroadcaster)\n emitTestRunHooks(supportCodeLibrary, eventBroadcaster)\n}\n"]}
|
package/lib/cli/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/cli/i18n.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAsB;AACtB,+CAA4C;AAC5C,4DAA8B;AAC9B,+CAA0C;AAE1C,MAAM,QAAQ,GAAG;IACf,SAAS;IACT,YAAY;IACZ,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,KAAK;IACL,KAAK;CACG,CAAA;AAEV,SAAS,UAAU,CAAC,MAAgB,EAAE,IAAgB;IACpD,MAAM,KAAK,GAAG,IAAI,oBAAK,CAAC;QACtB,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,aAAa,EAAE,EAAE;YACjB,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,EAAE;YAClB,IAAI,EAAE,E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EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC;QAC9C,OAAO;QACP,IAAI,CAAC,IAAI;QACT,IAAI,CAAC,MAAM;KACZ,CAAC,CAAA;IACF,OAAO,UAAU,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,CAAA;AACvE,CAAC;AAPD,oCAOC;AAED,SAAgB,WAAW,CAAC,OAAe;IACzC,MAAM,QAAQ,GAAG,kBAAQ,CAAC,OAAO,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,gBAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;QACvC,MAAM,KAAK,GAAG,gBAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClE,OAAO,CAAC,0BAAW,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAA;AACjE,CAAC;AAPD,kCAOC","sourcesContent":["import _ from 'lodash'\nimport { dialects } from '@cucumber/gherkin'\nimport Table from 'cli-table3'\nimport { capitalCase } from 'capital-case'\n\nconst keywords = [\n 'feature',\n 'background',\n 'scenario',\n 'scenarioOutline',\n 'examples',\n 'given',\n 'when',\n 'then',\n 'and',\n 'but',\n] as const\n\nfunction getAsTable(header: string[], rows: string[][]): string {\n const table = new Table({\n chars: {\n bottom: '',\n 'bottom-left': '',\n 'bottom-mid': '',\n 'bottom-right': '',\n left: '',\n 'left-mid': '',\n mid: '',\n 'mid-mid': '',\n middle: ' | ',\n right: '',\n 'right-mid': '',\n top: '',\n 'top-left': '',\n 'top-mid': '',\n 'top-right': '',\n },\n style: {\n border: [],\n 'padding-left': 0,\n 'padding-right': 0,\n },\n })\n table.push(header)\n table.push(...rows)\n return table.toString()\n}\n\nexport function getLanguages(): string {\n const rows = _.map(dialects, (data, isoCode) => [\n isoCode,\n data.name,\n data.native,\n ])\n return getAsTable(['ISO 639-1', 'ENGLISH NAME', 'NATIVE NAME'], rows)\n}\n\nexport function getKeywords(isoCode: string): string {\n const language = dialects[isoCode]\n const rows = _.map(keywords, (keyword) => {\n const words = _.map(language[keyword], (s) => `\"${s}\"`).join(', ')\n return [capitalCase(keyword), words]\n })\n return getAsTable(['ENGLISH KEYWORD', 'NATIVE KEYWORDS'], rows)\n}\n"]}
|
package/lib/cli/index.js
CHANGED
|
@@ -38,9 +38,9 @@ const runtime_1 = __importDefault(require("../runtime"));
|
|
|
38
38
|
const support_code_library_builder_1 = __importDefault(require("../support_code_library_builder"));
|
|
39
39
|
const messages_1 = require("@cucumber/messages");
|
|
40
40
|
const value_checker_1 = require("../value_checker");
|
|
41
|
-
const
|
|
42
|
-
const fs_2 = require("fs");
|
|
41
|
+
const gherkin_streams_1 = require("@cucumber/gherkin-streams");
|
|
43
42
|
const http_stream_1 = __importDefault(require("../formatter/http_stream"));
|
|
43
|
+
const stream_1 = require("stream");
|
|
44
44
|
const { incrementing, uuid } = messages_1.IdGenerator;
|
|
45
45
|
class Cli {
|
|
46
46
|
constructor({ argv, cwd, stdout, }) {
|
|
@@ -62,18 +62,30 @@ class Cli {
|
|
|
62
62
|
const formatters = await bluebird_1.default.map(formats, async ({ type, outputTo }) => {
|
|
63
63
|
let stream = this.stdout;
|
|
64
64
|
if (outputTo !== '') {
|
|
65
|
-
if (outputTo.match(
|
|
65
|
+
if (outputTo.match(/^https?:\/\//) !== null) {
|
|
66
66
|
const headers = {};
|
|
67
67
|
if (process.env.CUCUMBER_PUBLISH_TOKEN !== undefined) {
|
|
68
68
|
headers.Authorization = `Bearer ${process.env.CUCUMBER_PUBLISH_TOKEN}`;
|
|
69
69
|
}
|
|
70
|
-
stream = new http_stream_1.default(outputTo, 'GET', headers
|
|
70
|
+
stream = new http_stream_1.default(outputTo, 'GET', headers);
|
|
71
|
+
const readerStream = new stream_1.Writable({
|
|
72
|
+
objectMode: true,
|
|
73
|
+
write: function (responseBody, encoding, writeCallback) {
|
|
74
|
+
console.error(responseBody);
|
|
75
|
+
writeCallback();
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
stream.pipe(readerStream);
|
|
71
79
|
}
|
|
72
80
|
else {
|
|
73
81
|
const fd = await fs_1.default.open(path_1.default.resolve(this.cwd, outputTo), 'w');
|
|
74
82
|
stream = fs_1.default.createWriteStream(null, { fd });
|
|
75
83
|
}
|
|
76
84
|
}
|
|
85
|
+
stream.on('error', (error) => {
|
|
86
|
+
console.error(error.message);
|
|
87
|
+
process.exit(1);
|
|
88
|
+
});
|
|
77
89
|
const typeOptions = {
|
|
78
90
|
cwd: this.cwd,
|
|
79
91
|
eventBroadcaster,
|
|
@@ -105,7 +117,15 @@ class Cli {
|
|
|
105
117
|
getSupportCodeLibrary({ newId, supportCodeRequiredModules, supportCodePaths, }) {
|
|
106
118
|
supportCodeRequiredModules.map((module) => require(module));
|
|
107
119
|
support_code_library_builder_1.default.reset(this.cwd, newId);
|
|
108
|
-
supportCodePaths.forEach((codePath) =>
|
|
120
|
+
supportCodePaths.forEach((codePath) => {
|
|
121
|
+
try {
|
|
122
|
+
require(codePath);
|
|
123
|
+
}
|
|
124
|
+
catch (e) {
|
|
125
|
+
console.error(e.stack);
|
|
126
|
+
console.error('codepath: ' + codePath);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
109
129
|
return support_code_library_builder_1.default.finalize();
|
|
110
130
|
}
|
|
111
131
|
async run() {
|
|
@@ -137,21 +157,22 @@ class Cli {
|
|
|
137
157
|
supportCodeLibrary,
|
|
138
158
|
});
|
|
139
159
|
await helpers_2.emitMetaMessage(eventBroadcaster);
|
|
140
|
-
const gherkinMessageStream =
|
|
160
|
+
const gherkinMessageStream = gherkin_streams_1.GherkinStreams.fromPaths(configuration.featurePaths, {
|
|
141
161
|
defaultDialect: configuration.featureDefaultLanguage,
|
|
142
162
|
newId,
|
|
143
|
-
|
|
144
|
-
return fs_2.createReadStream(path, { encoding: 'utf-8' });
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
const pickleIds = await helpers_2.parseGherkinMessageStream({
|
|
148
|
-
cwd: this.cwd,
|
|
149
|
-
eventBroadcaster,
|
|
150
|
-
eventDataCollector,
|
|
151
|
-
gherkinMessageStream,
|
|
152
|
-
order: configuration.order,
|
|
153
|
-
pickleFilter: new pickle_filter_1.default(configuration.pickleFilterOptions),
|
|
163
|
+
relativeTo: this.cwd,
|
|
154
164
|
});
|
|
165
|
+
let pickleIds = [];
|
|
166
|
+
if (configuration.featurePaths.length > 0) {
|
|
167
|
+
pickleIds = await helpers_2.parseGherkinMessageStream({
|
|
168
|
+
cwd: this.cwd,
|
|
169
|
+
eventBroadcaster,
|
|
170
|
+
eventDataCollector,
|
|
171
|
+
gherkinMessageStream,
|
|
172
|
+
order: configuration.order,
|
|
173
|
+
pickleFilter: new pickle_filter_1.default(configuration.pickleFilterOptions),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
155
176
|
helpers_2.emitSupportCodeMessages({
|
|
156
177
|
eventBroadcaster,
|
|
157
178
|
supportCodeLibrary,
|
|
@@ -164,17 +185,13 @@ class Cli {
|
|
|
164
185
|
eventBroadcaster,
|
|
165
186
|
eventDataCollector,
|
|
166
187
|
options: configuration.runtimeOptions,
|
|
188
|
+
newId,
|
|
167
189
|
pickleIds,
|
|
168
190
|
supportCodeLibrary,
|
|
169
191
|
supportCodePaths: configuration.supportCodePaths,
|
|
170
192
|
supportCodeRequiredModules: configuration.supportCodeRequiredModules,
|
|
171
193
|
});
|
|
172
|
-
await
|
|
173
|
-
parallelRuntimeCoordinator.run(configuration.parallel, (s) => {
|
|
174
|
-
success = s;
|
|
175
|
-
resolve();
|
|
176
|
-
});
|
|
177
|
-
});
|
|
194
|
+
success = await parallelRuntimeCoordinator.run(configuration.parallel);
|
|
178
195
|
}
|
|
179
196
|
else {
|
|
180
197
|
const runtime = new runtime_1.default({
|