File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO
9
9
10
10
## [ Unreleased]
11
11
### Fixed
12
+ - Ensure package.json can be imported by consuming projects
13
+ ([ PR #1870 ] ( https://github.com/cucumber/cucumber-js/pull/1870 )
14
+ [ Issue #1869 ] ( https://github.com/cucumber/cucumber-js/issues/1869 ) )
12
15
- Allows for parentheses in paths for developers working on cucumber's own code ([[ #1735 ] ( https://github.com/cucumber/cucumber-js/issues/1735 )] )
13
16
- Smoother onboarding for Windows developers ([ #1863 ] ( https://github.com/cucumber/cucumber-js/pull/1863 ) )
14
17
Original file line number Diff line number Diff line change @@ -60,4 +60,26 @@ Feature: Core feature elements execution using direct imports
60
60
Given(/^a step passes$/, function() {});
61
61
"""
62
62
When I run cucumber-js
63
- Then it passes
63
+ Then it passes
64
+
65
+ Scenario : we can import the version number from package.json and from the library
66
+ Given a file named "features/a.feature" with:
67
+ """
68
+ Feature: some feature
69
+ Scenario: some scenario
70
+ Given a step checks the version number
71
+ """
72
+ And a file named "features/step_definitions/cucumber_steps.js" with:
73
+ """
74
+ const {Given} = require('@cucumber/cucumber')
75
+ const package_version = require('@cucumber/cucumber/package.json').version
76
+ const library_version = require('@cucumber/cucumber').version
77
+
78
+ Given(/^a step checks the version number$/, function() {
79
+ if (package_version !== library_version) {
80
+ throw new Error(`package version: ${package_version} !== library version: ${library_version}`)
81
+ }
82
+ });
83
+ """
84
+ When I run cucumber-js
85
+ Then it passes
Original file line number Diff line number Diff line change 175
175
},
176
176
"./lib/*" : {
177
177
"require" : " ./lib/*.js"
178
- }
178
+ },
179
+ "./package.json" : " ./package.json"
179
180
},
180
181
"types" : " ./lib/index.d.ts" ,
181
182
"engines" : {
You can’t perform that action at this time.
0 commit comments